BufferAccess

This commit is contained in:
Isaac Marovitz 2023-07-28 11:59:07 -04:00 committed by Isaac Marovitz
parent 8da7c42cf8
commit 4104af65a3

View file

@ -54,6 +54,12 @@ namespace Ryujinx.Graphics.Metal
public BufferHandle CreateBuffer(int size, BufferAccess access) public BufferHandle CreateBuffer(int size, BufferAccess access)
{ {
var buffer = _device.NewBuffer((ulong)size, MTLResourceOptions.ResourceStorageModeShared); var buffer = _device.NewBuffer((ulong)size, MTLResourceOptions.ResourceStorageModeShared);
if (access == BufferAccess.FlushPersistent)
{
buffer.SetPurgeableState(MTLPurgeableState.NonVolatile);
}
var bufferPtr = buffer.NativePtr; var bufferPtr = buffer.NativePtr;
return Unsafe.As<IntPtr, BufferHandle>(ref bufferPtr); return Unsafe.As<IntPtr, BufferHandle>(ref bufferPtr);
} }