diff --git a/src/Ryujinx.Graphics.OpenGL/Buffer.cs b/src/Ryujinx.Graphics.OpenGL/Buffer.cs index e7dcfbc3f..d71b3233d 100644 --- a/src/Ryujinx.Graphics.OpenGL/Buffer.cs +++ b/src/Ryujinx.Graphics.OpenGL/Buffer.cs @@ -32,22 +32,22 @@ namespace Ryujinx.Graphics.OpenGL return Handle.FromUInt32(api.GenBuffer()); } - public static BufferHandle Create(GL api, int size) + public unsafe static BufferHandle Create(GL api, int size) { uint handle = api.GenBuffer(); api.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle); - api.BufferData(BufferTargetARB.CopyWriteBuffer, (uint)size, in UIntPtr.Zero, BufferUsageARB.DynamicDraw); + api.BufferData(BufferTargetARB.CopyWriteBuffer, (uint)size, null, BufferUsageARB.DynamicDraw); return Handle.FromUInt32(handle); } - public static BufferHandle CreatePersistent(GL api, int size) + public unsafe static BufferHandle CreatePersistent(GL api, int size) { uint handle = api.GenBuffer(); api.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle); - api.BufferStorage(BufferStorageTarget.CopyWriteBuffer, (uint)size, in UIntPtr.Zero, + api.BufferStorage(BufferStorageTarget.CopyWriteBuffer, (uint)size, null, BufferStorageMask.MapPersistentBit | BufferStorageMask.MapCoherentBit | BufferStorageMask.ClientStorageBit | @@ -92,10 +92,10 @@ namespace Ryujinx.Graphics.OpenGL return new PinnedSpan(target.ToPointer(), size); } - public static void Resize(GL api, BufferHandle handle, int size) + public unsafe static void Resize(GL api, BufferHandle handle, int size) { api.BindBuffer(BufferTargetARB.CopyWriteBuffer, handle.ToUInt32()); - api.BufferData(BufferTargetARB.CopyWriteBuffer, (uint)size, in UIntPtr.Zero, BufferUsageARB.StreamCopy); + api.BufferData(BufferTargetARB.CopyWriteBuffer, (uint)size, null, BufferUsageARB.StreamCopy); } public static void SetData(GL api, BufferHandle buffer, int offset, ReadOnlySpan data) diff --git a/src/Ryujinx.Graphics.OpenGL/Debugger.cs b/src/Ryujinx.Graphics.OpenGL/Debugger.cs index 1a3107ef3..e98cfb10f 100644 --- a/src/Ryujinx.Graphics.OpenGL/Debugger.cs +++ b/src/Ryujinx.Graphics.OpenGL/Debugger.cs @@ -13,7 +13,7 @@ namespace Ryujinx.Graphics.OpenGL private static int _counter; - public static void Initialize(GL gl, GraphicsDebugLevel logLevel) + public unsafe static void Initialize(GL gl, GraphicsDebugLevel logLevel) { // Disable everything gl.DebugMessageControl(DebugSource.DontCare, DebugType.DontCare, DebugSeverity.DontCare, 0, (uint[])null, false); @@ -21,7 +21,7 @@ namespace Ryujinx.Graphics.OpenGL if (logLevel == GraphicsDebugLevel.None) { gl.Disable(EnableCap.DebugOutputSynchronous); - gl.DebugMessageCallback(null, in IntPtr.Zero); + gl.DebugMessageCallback(null, null); return; } @@ -45,7 +45,7 @@ namespace Ryujinx.Graphics.OpenGL _counter = 0; _debugCallback = GLDebugHandler; - gl.DebugMessageCallback(_debugCallback, in IntPtr.Zero); + gl.DebugMessageCallback(_debugCallback, null); Logger.Warning?.Print(LogClass.Gpu, "OpenGL Debugging is enabled. Performance will be negatively impacted."); } diff --git a/src/Ryujinx.Graphics.OpenGL/Image/TextureCopy.cs b/src/Ryujinx.Graphics.OpenGL/Image/TextureCopy.cs index a3a65b9b2..93f9e13b6 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/TextureCopy.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/TextureCopy.cs @@ -442,7 +442,7 @@ namespace Ryujinx.Graphics.OpenGL.Image _gd.Api.BindBuffer(BufferTargetARB.PixelUnpackBuffer, 0); } - private void EnsurePbo(TextureView view) + private unsafe void EnsurePbo(TextureView view) { int requiredSize = 0; @@ -464,7 +464,7 @@ namespace Ryujinx.Graphics.OpenGL.Image _copyPboSize = requiredSize; _gd.Api.BindBuffer(BufferTargetARB.PixelPackBuffer, _copyPboHandle); - _gd.Api.BufferData(BufferTargetARB.PixelPackBuffer, (uint)requiredSize, in IntPtr.Zero, BufferUsageARB.DynamicCopy); + _gd.Api.BufferData(BufferTargetARB.PixelPackBuffer, (uint)requiredSize, null, BufferUsageARB.DynamicCopy); } } diff --git a/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs b/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs index e80099499..b578946eb 100644 --- a/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs +++ b/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs @@ -87,7 +87,7 @@ namespace Ryujinx.Graphics.OpenGL _copyBufferSize = requiredSize; _api.BindBuffer(BufferTargetARB.CopyWriteBuffer, _copyBufferHandle); - _api.BufferStorage(BufferStorageTarget.CopyWriteBuffer, (uint)requiredSize, in IntPtr.Zero, BufferStorageMask.MapReadBit | BufferStorageMask.MapPersistentBit); + _api.BufferStorage(BufferStorageTarget.CopyWriteBuffer, (uint)requiredSize, null, BufferStorageMask.MapReadBit | BufferStorageMask.MapPersistentBit); _bufferMap = (IntPtr)_api.MapBufferRange(BufferTargetARB.CopyWriteBuffer, IntPtr.Zero, (uint)requiredSize, MapBufferAccessMask.ReadBit | MapBufferAccessMask.PersistentBit); }