From 1f9bfab9239402204933dfbb462fbf2c710b3dc0 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 10 May 2026 23:18:23 +0000 Subject: [PATCH] Updated OpenGL calls to no longer be deprecated (#83) - updated SharpCompress 0.47.4 -> 0.48.0 (security) - set ProcessResult to be nullable (since it is) Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/83 --- Directory.Packages.props | 4 ++-- .../Image/TextureView.cs | 18 +++++++++--------- .../PersistentBuffers.cs | 4 ++-- src/Ryujinx.Graphics.OpenGL/Pipeline.cs | 10 +++++----- src/Ryujinx.Graphics.OpenGL/Program.cs | 2 +- .../Queries/BufferedQuery.cs | 2 +- .../Loaders/Processes/ProcessLoader.cs | 2 ++ 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 7c94ffe24..4466f2777 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,7 +8,7 @@ - + @@ -64,4 +64,4 @@ - + \ No newline at end of file diff --git a/src/Ryujinx.Graphics.OpenGL/Image/TextureView.cs b/src/Ryujinx.Graphics.OpenGL/Image/TextureView.cs index 12ec23c8b..9b1df80dc 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/TextureView.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/TextureView.cs @@ -551,7 +551,7 @@ namespace Ryujinx.Graphics.OpenGL.Image level, x, width, - format.PixelFormat, + (InternalFormat) format.PixelFormat, mipSize, data); } @@ -579,7 +579,7 @@ namespace Ryujinx.Graphics.OpenGL.Image layer, width, 1, - format.PixelFormat, + (InternalFormat) format.PixelFormat, mipSize, data); } @@ -609,7 +609,7 @@ namespace Ryujinx.Graphics.OpenGL.Image y, width, height, - format.PixelFormat, + (InternalFormat) format.PixelFormat, mipSize, data); } @@ -643,7 +643,7 @@ namespace Ryujinx.Graphics.OpenGL.Image width, height, 1, - format.PixelFormat, + (InternalFormat) format.PixelFormat, mipSize, data); } @@ -675,7 +675,7 @@ namespace Ryujinx.Graphics.OpenGL.Image y, width, height, - format.PixelFormat, + (InternalFormat) format.PixelFormat, mipSize, data); } @@ -744,7 +744,7 @@ namespace Ryujinx.Graphics.OpenGL.Image level, 0, width, - format.PixelFormat, + (InternalFormat) format.PixelFormat, mipSize, data); } @@ -773,7 +773,7 @@ namespace Ryujinx.Graphics.OpenGL.Image 0, width, height, - format.PixelFormat, + (InternalFormat) format.PixelFormat, mipSize, data); } @@ -807,7 +807,7 @@ namespace Ryujinx.Graphics.OpenGL.Image width, height, depth, - format.PixelFormat, + (InternalFormat) format.PixelFormat, mipSize, data); } @@ -843,7 +843,7 @@ namespace Ryujinx.Graphics.OpenGL.Image 0, width, height, - format.PixelFormat, + (InternalFormat) format.PixelFormat, mipSize / 6, data + faceOffset); } diff --git a/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs b/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs index d5c02f4df..b77ac5f17 100644 --- a/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs +++ b/src/Ryujinx.Graphics.OpenGL/PersistentBuffers.cs @@ -27,7 +27,7 @@ namespace Ryujinx.Graphics.OpenGL public void Map(BufferHandle handle, int size) { GL.BindBuffer(BufferTarget.CopyWriteBuffer, handle); - nint ptr = GL.MapBufferRange(BufferTarget.CopyWriteBuffer, nint.Zero, size, BufferAccessMask.MapReadBit | BufferAccessMask.MapPersistentBit); + nint ptr = GL.MapBufferRange(BufferTarget.CopyWriteBuffer, nint.Zero, size, MapBufferAccessMask.MapReadBit | MapBufferAccessMask.MapPersistentBit); _maps[handle] = ptr; } @@ -75,7 +75,7 @@ namespace Ryujinx.Graphics.OpenGL GL.BindBuffer(BufferTarget.CopyWriteBuffer, _copyBufferHandle); GL.BufferStorage(BufferTarget.CopyWriteBuffer, requiredSize, nint.Zero, BufferStorageFlags.MapReadBit | BufferStorageFlags.MapPersistentBit); - _bufferMap = GL.MapBufferRange(BufferTarget.CopyWriteBuffer, nint.Zero, requiredSize, BufferAccessMask.MapReadBit | BufferAccessMask.MapPersistentBit); + _bufferMap = GL.MapBufferRange(BufferTarget.CopyWriteBuffer, nint.Zero, requiredSize, MapBufferAccessMask.MapReadBit | MapBufferAccessMask.MapPersistentBit); } } diff --git a/src/Ryujinx.Graphics.OpenGL/Pipeline.cs b/src/Ryujinx.Graphics.OpenGL/Pipeline.cs index e58e6f2b9..5b1e63e3b 100644 --- a/src/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/src/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -924,8 +924,8 @@ namespace Ryujinx.Graphics.OpenGL GL.Disable(EnableCap.CullFace); return; } - - GL.CullFace(face.Convert()); + + GL.CullFace((TriangleFace) face.Convert()); GL.Enable(EnableCap.CullFace); } @@ -1085,12 +1085,12 @@ namespace Ryujinx.Graphics.OpenGL { if (frontMode == backMode) { - GL.PolygonMode(MaterialFace.FrontAndBack, frontMode.Convert()); + GL.PolygonMode((TriangleFace) MaterialFace.FrontAndBack, frontMode.Convert()); } else { - GL.PolygonMode(MaterialFace.Front, frontMode.Convert()); - GL.PolygonMode(MaterialFace.Back, backMode.Convert()); + GL.PolygonMode((TriangleFace) MaterialFace.Front, frontMode.Convert()); + GL.PolygonMode((TriangleFace) MaterialFace.Back, backMode.Convert()); } } diff --git a/src/Ryujinx.Graphics.OpenGL/Program.cs b/src/Ryujinx.Graphics.OpenGL/Program.cs index 608a03451..cb9933c10 100644 --- a/src/Ryujinx.Graphics.OpenGL/Program.cs +++ b/src/Ryujinx.Graphics.OpenGL/Program.cs @@ -59,7 +59,7 @@ namespace Ryujinx.Graphics.OpenGL GL.CompileShader(shaderHandle); break; case TargetLanguage.Spirv: - GL.ShaderBinary(1, ref shaderHandle, (BinaryFormat)All.ShaderBinaryFormatSpirVArb, shader.BinaryCode, shader.BinaryCode.Length); + GL.ShaderBinary(1, ref shaderHandle, ShaderBinaryFormat.ShaderBinaryFormatSpirV, shader.BinaryCode, shader.BinaryCode.Length); GL.SpecializeShader(shaderHandle, "main", 0, (int[])null, (int[])null); break; } diff --git a/src/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs b/src/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs index f39829923..c9dbcdcf2 100644 --- a/src/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs +++ b/src/Ryujinx.Graphics.OpenGL/Queries/BufferedQuery.cs @@ -32,7 +32,7 @@ namespace Ryujinx.Graphics.OpenGL.Queries GL.BufferStorage(BufferTarget.QueryBuffer, sizeof(long), (nint)(&defaultValue), BufferStorageFlags.MapReadBit | BufferStorageFlags.MapWriteBit | BufferStorageFlags.MapPersistentBit); } - _bufferMap = GL.MapBufferRange(BufferTarget.QueryBuffer, nint.Zero, sizeof(long), BufferAccessMask.MapReadBit | BufferAccessMask.MapWriteBit | BufferAccessMask.MapPersistentBit); + _bufferMap = GL.MapBufferRange(BufferTarget.QueryBuffer, nint.Zero, sizeof(long), MapBufferAccessMask.MapReadBit | MapBufferAccessMask.MapWriteBit | MapBufferAccessMask.MapPersistentBit); } public void Reset() diff --git a/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs b/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs index e0edd2df5..900703f6e 100644 --- a/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs +++ b/src/Ryujinx.HLE/Loaders/Processes/ProcessLoader.cs @@ -28,6 +28,7 @@ namespace Ryujinx.HLE.Loaders.Processes private ulong _latestPid; +#nullable enable public ProcessResult? ActiveApplication { get @@ -44,6 +45,7 @@ namespace Ryujinx.HLE.Loaders.Processes return value; } } +#nullable disable public ProcessLoader(Switch device) {