From 33ba1703158564c2c3564fa329fd2e630f8a8e95 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 22 Oct 2023 15:31:36 -0300 Subject: [PATCH] Fix NRE on gather operations with depth compare on macOS (#5832) --- src/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs b/src/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs index 5a231079a..55f7d5778 100644 --- a/src/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs +++ b/src/Ryujinx.Graphics.Shader/Instructions/InstEmitTexture.cs @@ -766,7 +766,10 @@ namespace Ryujinx.Graphics.Shader.Instructions flags |= offset == TexOffset.Ptp ? TextureFlags.Offsets : TextureFlags.Offset; } - sourcesList.Add(Const((int)component)); + if (!hasDepthCompare) + { + sourcesList.Add(Const((int)component)); + } Operand[] sources = sourcesList.ToArray(); Operand[] dests = new Operand[BitOperations.PopCount((uint)componentMask)];