From 2121f69b1cb2e9c6e4ab9fc405e616b3f94a021e Mon Sep 17 00:00:00 2001 From: gdk Date: Sun, 10 Apr 2022 21:51:21 -0300 Subject: [PATCH] We don't need to recompile shaders if alpha test state changed but alpha test is disabled --- .../Shader/ShaderSpecializationState.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs b/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs index 120a4b179..172ce14ce 100644 --- a/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs +++ b/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs @@ -460,9 +460,14 @@ namespace Ryujinx.Graphics.Gpu.Shader return false; } - if (graphicsState.AlphaTestEnable != GraphicsState.AlphaTestEnable || - graphicsState.AlphaTestCompare != GraphicsState.AlphaTestCompare || - graphicsState.AlphaTestReference != GraphicsState.AlphaTestReference) + if (graphicsState.AlphaTestEnable != GraphicsState.AlphaTestEnable) + { + return false; + } + + if (graphicsState.AlphaTestEnable && + (graphicsState.AlphaTestCompare != GraphicsState.AlphaTestCompare || + graphicsState.AlphaTestReference != GraphicsState.AlphaTestReference)) { return false; }