BufferAccess

This commit is contained in:
Isaac Marovitz 2023-07-28 11:59:07 -04:00
parent 964233d458
commit 93054ce3dc
No known key found for this signature in database
GPG Key ID: 97250B2B09A132E1
1 changed files with 6 additions and 0 deletions

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);
}