Set logicOp and DepthCompareOp only if enabled

This commit is contained in:
sunshineinabox 2024-07-23 22:03:47 -07:00
parent 2cba50a9ed
commit ea44670330
1 changed files with 3 additions and 7 deletions

View File

@ -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;