1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-24 10:06:01 +00:00

CopyBuffer to Buffer

This commit is contained in:
Isaac Marovitz 2023-07-28 23:56:33 -04:00 committed by Isaac Marovitz
parent 7a2ab77b4d
commit 33a986317b

View file

@ -133,7 +133,26 @@ namespace Ryujinx.Graphics.Metal
public void CopyBuffer(BufferHandle source, BufferHandle destination, int srcOffset, int dstOffset, int size)
{
throw new NotImplementedException();
MTLBlitCommandEncoder blitCommandEncoder;
if (CurrentEncoder is MTLBlitCommandEncoder encoder)
{
blitCommandEncoder = encoder;
}
else
{
blitCommandEncoder = BeginBlitPass();
}
MTLBuffer sourceBuffer = new(Unsafe.As<BufferHandle, IntPtr>(ref source));
MTLBuffer destinationBuffer = new(Unsafe.As<BufferHandle, IntPtr>(ref destination));
blitCommandEncoder.CopyFromBuffer(
sourceBuffer,
(ulong)srcOffset,
destinationBuffer,
(ulong)dstOffset,
(ulong)size);
}
public void DispatchCompute(int groupsX, int groupsY, int groupsZ)