aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs')
-rw-r--r--src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs b/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs
index aac288b7..ebfe3ad6 100644
--- a/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs
+++ b/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs
@@ -11,10 +11,10 @@ namespace Ryujinx.Graphics.OpenGL
{
class PersistentBuffers : IDisposable
{
- private PersistentBuffer _main = new PersistentBuffer();
- private PersistentBuffer _background = new PersistentBuffer();
+ private readonly PersistentBuffer _main = new();
+ private readonly PersistentBuffer _background = new();
- private Dictionary<BufferHandle, IntPtr> _maps = new Dictionary<BufferHandle, IntPtr>();
+ private readonly Dictionary<BufferHandle, IntPtr> _maps = new();
public PersistentBuffer Default => BackgroundContextWorker.InBackground ? _background : _main;
@@ -91,7 +91,7 @@ namespace Ryujinx.Graphics.OpenGL
return _dataMap;
}
- private void Sync()
+ private static void Sync()
{
GL.MemoryBarrier(MemoryBarrierFlags.ClientMappedBufferBarrierBit);
@@ -133,7 +133,7 @@ namespace Ryujinx.Graphics.OpenGL
Sync();
- return new ReadOnlySpan<byte>(_bufferMap.ToPointer(), size).Slice(offset);
+ return new ReadOnlySpan<byte>(_bufferMap.ToPointer(), size)[offset..];
}
public unsafe ReadOnlySpan<byte> GetBufferData(BufferHandle buffer, int offset, int size)