diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-01-12 18:50:54 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-13 08:50:54 +1100 |
| commit | df820a72def62319fe97236a2006c64bfb7c065a (patch) | |
| tree | 0e5d2c4f278548245e828e67194ff03d04532ce3 /Ryujinx.Graphics.Gpu/Engine/MethodCopyBuffer.cs | |
| parent | 68f6b79fd3f06ea572d5f0edd5fc8cbaee1ae449 (diff) | |
Implement clear buffer (fast path) (#1902)
* Implement clear buffer (fast path)
* Remove blank line
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/MethodCopyBuffer.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/MethodCopyBuffer.cs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/MethodCopyBuffer.cs b/Ryujinx.Graphics.Gpu/Engine/MethodCopyBuffer.cs index 6f03dc5d..15ebb236 100644 --- a/Ryujinx.Graphics.Gpu/Engine/MethodCopyBuffer.cs +++ b/Ryujinx.Graphics.Gpu/Engine/MethodCopyBuffer.cs @@ -200,8 +200,24 @@ namespace Ryujinx.Graphics.Gpu.Engine } else { - // Buffer to buffer copy. - BufferManager.CopyBuffer(cbp.SrcAddress, cbp.DstAddress, (uint)size); + if (remap && + swizzle.UnpackDstX() == BufferSwizzleComponent.ConstA && + swizzle.UnpackDstY() == BufferSwizzleComponent.ConstA && + swizzle.UnpackDstZ() == BufferSwizzleComponent.ConstA && + swizzle.UnpackDstW() == BufferSwizzleComponent.ConstA && + swizzle.UnpackSrcComponentsCount() == 1 && + swizzle.UnpackDstComponentsCount() == 1 && + swizzle.UnpackComponentSize() == 4) + { + // Fast path for clears when remap is enabled. + BufferManager.ClearBuffer(cbp.DstAddress, (uint)size * 4, state.Get<uint>(MethodOffset.CopyBufferConstA)); + } + else + { + // TODO: Implement remap functionality. + // Buffer to buffer copy. + BufferManager.CopyBuffer(cbp.SrcAddress, cbp.DstAddress, (uint)size); + } } } } |
