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)
{
var buffer = _device.NewBuffer((ulong)size, MTLResourceOptions.ResourceStorageModeShared);
if (access == BufferAccess.FlushPersistent)
{
buffer.SetPurgeableState(MTLPurgeableState.NonVolatile);
}
var bufferPtr = buffer.NativePtr;
return Unsafe.As<IntPtr, BufferHandle>(ref bufferPtr);
}