Reduce unneeded state changes

This commit is contained in:
sunshineinabox 2024-05-29 09:45:56 -07:00
parent 5c65880ec0
commit e6492f8e78
3 changed files with 40 additions and 17 deletions

View file

@ -880,12 +880,10 @@ namespace Ryujinx.Graphics.Vulkan
public void SetDepthBias(PolygonModeMask enables, float factor, float units, float clamp)
{
DynamicState.SetDepthBias(factor, units, clamp, (enables != 0));
bool enable = enables != 0;
DynamicState.SetDepthBias(factor, units, clamp, enable);
if (!_supportExtDynamic2)
{
_newState.DepthBiasEnable = enables != 0;
}
_newState.DepthBiasEnable = enable;
SignalStateChange();
}
@ -919,11 +917,12 @@ namespace Ryujinx.Graphics.Vulkan
}
else
{
_newState.DepthTestEnable = depthTest.TestEnable;
_newState.DepthWriteEnable = depthTest.WriteEnable;
_newState.DepthCompareOp = depthTest.Func.Convert();
}
_newState.DepthTestEnable = depthTest.TestEnable;
SignalStateChange();
}