From 4104af65a3db65dd3771f7d98d15f0c837708287 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 28 Jul 2023 11:59:07 -0400 Subject: [PATCH] BufferAccess --- src/Ryujinx.Graphics.Metal/MetalRenderer.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Ryujinx.Graphics.Metal/MetalRenderer.cs b/src/Ryujinx.Graphics.Metal/MetalRenderer.cs index 1c4db1a01..787f01c6e 100644 --- a/src/Ryujinx.Graphics.Metal/MetalRenderer.cs +++ b/src/Ryujinx.Graphics.Metal/MetalRenderer.cs @@ -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(ref bufferPtr); }