mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-12-20 07:12:02 +00:00
BufferAccess
This commit is contained in:
parent
8da7c42cf8
commit
4104af65a3
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue