diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index 275ec9228..795a1f2ea 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -793,24 +793,22 @@ namespace Ryujinx.Graphics.Vulkan } bool depthBiasEnable = (enables != PolygonModeMask.None) && (factor != 0 && units != 0); - bool changed = false; if (_newState.DepthBiasEnable != depthBiasEnable) { _newState.DepthBiasEnable = depthBiasEnable; - changed = true; } if (depthBiasEnable) { DynamicState.SetDepthBias(factor, units, clamp); - changed = true; + } + else + { + DynamicState.SetDepthBias(0, 0, 0); } - if (changed) - { - SignalStateChange(); - } + SignalStateChange(); } public void SetDepthClamp(bool clamp) diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs index cfb7ef361..12c0e2bee 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs @@ -565,12 +565,7 @@ namespace Ryujinx.Graphics.Vulkan bool supportsExtDynamicState = gd.Capabilities.SupportsExtendedDynamicState; - int dynamicStatesCount = supportsExtDynamicState ? 7 : 6; - - if (DepthBiasEnable) - { - dynamicStatesCount++; - } + int dynamicStatesCount = supportsExtDynamicState ? 8 : 7; DynamicState* dynamicStates = stackalloc DynamicState[dynamicStatesCount]; @@ -580,17 +575,11 @@ namespace Ryujinx.Graphics.Vulkan dynamicStates[3] = DynamicState.StencilWriteMask; dynamicStates[4] = DynamicState.StencilReference; dynamicStates[5] = DynamicState.BlendConstants; - - dynamicStatesCount = 6; - - if (DepthBiasEnable) - { - dynamicStates[dynamicStatesCount++] = DynamicState.DepthBias; - } + dynamicStates[6] = DynamicState.DepthBias; if (supportsExtDynamicState) { - dynamicStates[dynamicStatesCount++] = DynamicState.VertexInputBindingStrideExt; + dynamicStates[7] = DynamicState.VertexInputBindingStrideExt; } var pipelineDynamicStateCreateInfo = new PipelineDynamicStateCreateInfo