mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-20 08:12:01 +00:00
CopyBuffer to Buffer
This commit is contained in:
parent
7a2ab77b4d
commit
33a986317b
1 changed files with 20 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue