Only enable enable LogicOp dynamic state and logic op if its enabled.

This commit is contained in:
sunshineinabox 2024-05-29 08:36:24 -07:00
parent 424166acd8
commit efdcce4415
2 changed files with 11 additions and 11 deletions

View file

@ -1001,20 +1001,20 @@ namespace Ryujinx.Graphics.Vulkan
public void SetLogicOpState(bool enable, LogicalOp op)
{
if (Gd.ExtendedDynamicState2Features.ExtendedDynamicState2LogicOp)
{
DynamicState.SetLogicOp(op.Convert());
}
else
{
_newState.LogicOp = op.Convert();
}
// Vendors other than NVIDIA have a bug where it enables logical operations even for float formats,
// so we need to force disable them here.
bool logicOpEnable = enable && (Gd.Vendor == Vendor.Nvidia || _newState.Internal.LogicOpsAllowed);
_newState.LogicOpEnable = logicOpEnable;
if (Gd.ExtendedDynamicState2Features.ExtendedDynamicState2LogicOp && logicOpEnable)
{
DynamicState.SetLogicOp(op.Convert());
}
else if (logicOpEnable)
{
_newState.LogicOp = op.Convert();
}
SignalStateChange();
}

View file

@ -595,7 +595,7 @@ namespace Ryujinx.Graphics.Vulkan
if (supportsExtDynamicState2)
{
additionalDynamicStatesCount += 3;
if (gd.ExtendedDynamicState2Features.ExtendedDynamicState2LogicOp)
if (gd.ExtendedDynamicState2Features.ExtendedDynamicState2LogicOp && LogicOpEnable)
{
additionalDynamicStatesCount++;
}
@ -649,7 +649,7 @@ namespace Ryujinx.Graphics.Vulkan
dynamicStates[currentIndex++] = DynamicState.RasterizerDiscardEnableExt;
dynamicStates[currentIndex++] = DynamicState.PrimitiveRestartEnableExt;
if (gd.ExtendedDynamicState2Features.ExtendedDynamicState2LogicOp)
if (gd.ExtendedDynamicState2Features.ExtendedDynamicState2LogicOp && LogicOpEnable)
{
dynamicStates[currentIndex++] = DynamicState.LogicOpExt;
}