mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-08-06 07:52:33 -07:00
BufferAccess
This commit is contained in:
committed by
Isaac Marovitz
parent
8da7c42cf8
commit
4104af65a3
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user