mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-27 19:13:04 +00:00
Clear Buffer
This commit is contained in:
parent
28da4248ae
commit
d076a70816
2 changed files with 22 additions and 1 deletions
|
@ -92,7 +92,27 @@ namespace Ryujinx.Graphics.Metal
|
|||
|
||||
public void ClearBuffer(BufferHandle destination, int offset, int size, uint value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
MTLBlitCommandEncoder blitCommandEncoder;
|
||||
|
||||
if (_currentEncoder is MTLBlitCommandEncoder encoder)
|
||||
{
|
||||
blitCommandEncoder = encoder;
|
||||
}
|
||||
else
|
||||
{
|
||||
blitCommandEncoder = BeginBlitPass();
|
||||
}
|
||||
|
||||
// Might need a closer look, range's count, lower, and upper bound
|
||||
// must be a multiple of 4
|
||||
MTLBuffer mtlBuffer = new(Unsafe.As<BufferHandle, IntPtr>(ref destination));
|
||||
blitCommandEncoder.FillBuffer(mtlBuffer,
|
||||
new NSRange
|
||||
{
|
||||
location = (ulong)offset,
|
||||
length = (ulong)size
|
||||
},
|
||||
(byte)value);
|
||||
}
|
||||
|
||||
public void ClearRenderTargetColor(int index, int layer, int layerCount, uint componentMask, ColorF color)
|
||||
|
|
|
@ -136,6 +136,7 @@ namespace Ryujinx.Graphics.Metal
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
// TODO: Rewrite using MTLBlitCommandEncoder
|
||||
public void SetData(SpanOrArray<byte> data, int layer, int level, Rectangle<int> region)
|
||||
{
|
||||
ulong bytesPerRow = (ulong)Info.GetMipStride(level);
|
||||
|
|
Loading…
Reference in a new issue