diff --git a/src/Ryujinx.Graphics.OpenGL/Pipeline.cs b/src/Ryujinx.Graphics.OpenGL/Pipeline.cs index e863c696b9..0757fcd99f 100644 --- a/src/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/src/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -1117,7 +1117,7 @@ namespace Ryujinx.Graphics.OpenGL prg.Bind(); } - if (prg.HasFragmentShader && _fragmentOutputMap != (uint)prg.FragmentOutputMap) + if (_fragmentOutputMap != (uint)prg.FragmentOutputMap) { _fragmentOutputMap = (uint)prg.FragmentOutputMap; diff --git a/src/Ryujinx.Graphics.OpenGL/Program.cs b/src/Ryujinx.Graphics.OpenGL/Program.cs index cc9120c7c5..19de06f8f2 100644 --- a/src/Ryujinx.Graphics.OpenGL/Program.cs +++ b/src/Ryujinx.Graphics.OpenGL/Program.cs @@ -30,7 +30,6 @@ namespace Ryujinx.Graphics.OpenGL private ProgramLinkStatus _status = ProgramLinkStatus.Incomplete; private int[] _shaderHandles; - public bool HasFragmentShader; public int FragmentOutputMap { get; } public Program(ShaderSource[] shaders, int fragmentOutputMap) @@ -40,6 +39,7 @@ namespace Ryujinx.Graphics.OpenGL GL.ProgramParameter(Handle, ProgramParameterName.ProgramBinaryRetrievableHint, 1); _shaderHandles = new int[shaders.Length]; + bool hasFragmentShader = false; for (int index = 0; index < shaders.Length; index++) { @@ -47,7 +47,7 @@ namespace Ryujinx.Graphics.OpenGL if (shader.Stage == ShaderStage.Fragment) { - HasFragmentShader = true; + hasFragmentShader = true; } int shaderHandle = GL.CreateShader(shader.Stage.Convert()); @@ -71,7 +71,7 @@ namespace Ryujinx.Graphics.OpenGL GL.LinkProgram(Handle); - FragmentOutputMap = fragmentOutputMap; + FragmentOutputMap = hasFragmentShader ? fragmentOutputMap : 0; } public Program(ReadOnlySpan code, bool hasFragmentShader, int fragmentOutputMap) @@ -91,8 +91,7 @@ namespace Ryujinx.Graphics.OpenGL } } - HasFragmentShader = hasFragmentShader; - FragmentOutputMap = fragmentOutputMap; + FragmentOutputMap = hasFragmentShader ? fragmentOutputMap : 0; } public void Bind()