From 91f63270cce92e741e1c6d31c5059cf7a789cc7c Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Tue, 14 May 2024 12:30:34 -0400 Subject: [PATCH] Sunshine Fixes --- src/Ryujinx.Graphics.OpenGL/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Graphics.OpenGL/Program.cs b/src/Ryujinx.Graphics.OpenGL/Program.cs index 11a064fa1..b96f00958 100644 --- a/src/Ryujinx.Graphics.OpenGL/Program.cs +++ b/src/Ryujinx.Graphics.OpenGL/Program.cs @@ -62,7 +62,7 @@ namespace Ryujinx.Graphics.OpenGL _gd.Api.CompileShader(shaderHandle); break; case TargetLanguage.Spirv: - fixed (byte* ptr = shader.BinaryCode.AsSpan()) + fixed (byte* ptr = shader.BinaryCode) { _gd.Api.ShaderBinary(1, in shaderHandle, ShaderBinaryFormat.ShaderBinaryFormatSpirV, ptr, (uint)shader.BinaryCode.Length); } @@ -146,7 +146,7 @@ namespace Ryujinx.Graphics.OpenGL { _gd.Api.GetProgram(Handle, ProgramPropertyARB.ProgramBinaryLength, out int size); - byte[] data = new byte[size]; + byte[] data = new byte[size + 4]; GLEnum binFormat; fixed (byte* ptr = data) @@ -154,7 +154,7 @@ namespace Ryujinx.Graphics.OpenGL _gd.Api.GetProgramBinary(Handle, (uint)size, out _, out binFormat, ptr); } - BinaryPrimitives.WriteInt32LittleEndian(data, (int)binFormat); + BinaryPrimitives.WriteInt32LittleEndian(data.AsSpan(size, 4), (int)binFormat); return data; }