Remove redundant logic, just use max possible dynamic states

This commit is contained in:
sunshineinabox 2024-07-31 18:51:44 -07:00
parent 38c9ec925c
commit 1bcc9c029a

View file

@ -565,34 +565,7 @@ namespace Ryujinx.Graphics.Vulkan
colorBlendState.PNext = &colorBlendAdvancedState;
}
int baseDynamicStatesCount = 7;
int additionalDynamicStatesCount = 0;
if (!isMoltenVk)
{
baseDynamicStatesCount++;
}
if (supportsExtDynamicState)
{
additionalDynamicStatesCount += isMoltenVk ? 8 : 9;
}
if (supportsExtDynamicState2)
{
additionalDynamicStatesCount += 3;
if (gd.ExtendedDynamicState2Features.ExtendedDynamicState2LogicOp)
{
additionalDynamicStatesCount++;
}
if (gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints && HasTessellationControlShader)
{
additionalDynamicStatesCount++;
}
}
int dynamicStatesCount = baseDynamicStatesCount + additionalDynamicStatesCount;
DynamicState* dynamicStates = stackalloc DynamicState[dynamicStatesCount];
DynamicState* dynamicStates = stackalloc DynamicState[22];
dynamicStates[0] = DynamicState.Viewport;
dynamicStates[1] = DynamicState.Scissor;
@ -649,11 +622,10 @@ namespace Ryujinx.Graphics.Vulkan
var pipelineDynamicStateCreateInfo = new PipelineDynamicStateCreateInfo
{
SType = StructureType.PipelineDynamicStateCreateInfo,
DynamicStateCount = (uint)dynamicStatesCount,
DynamicStateCount = (uint)currentIndex,
PDynamicStates = dynamicStates,
};
var pipelineCreateInfo = new GraphicsPipelineCreateInfo
{
SType = StructureType.GraphicsPipelineCreateInfo,