From ea44670330d5bc0df405c86755ae8646d00e7341 Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Tue, 23 Jul 2024 22:03:47 -0700 Subject: [PATCH] Set logicOp and DepthCompareOp only if enabled --- src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs index da79a42c5..c1a7d52d7 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs @@ -178,7 +178,7 @@ namespace Ryujinx.Graphics.Vulkan if (!gd.ExtendedDynamicState2Features.ExtendedDynamicState2LogicOp) { - pipeline.LogicOp = state.LogicOp.Convert(); + pipeline.LogicOp = state.LogicOpEnable ? state.LogicOp.Convert() : default; } if (!gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints) @@ -192,13 +192,9 @@ namespace Ryujinx.Graphics.Vulkan if (!gd.Capabilities.SupportsExtendedDynamicState) { pipeline.DepthTestEnable = state.DepthTest.TestEnable; + pipeline.DepthWriteEnable = state.DepthTest.WriteEnable && state.DepthTest.TestEnable; - if (pipeline.DepthTestEnable) - { - pipeline.DepthWriteEnable = state.DepthTest.WriteEnable; - } - - pipeline.DepthCompareOp = state.DepthTest.Func.Convert(); + pipeline.DepthCompareOp = state.DepthTest.TestEnable ? state.DepthTest.Func.Convert() : default; pipeline.CullMode = state.CullEnable ? state.CullMode.Convert() : CullModeFlags.None;