Implement clear buffer (fast path) (#1902)

* Implement clear buffer (fast path)

* Remove blank line
This commit is contained in:
gdkchan 2021-01-12 18:50:54 -03:00 committed by GitHub
parent 68f6b79fd3
commit df820a72de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 125 additions and 5 deletions

View file

@ -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);
}
}
}
}