From 1bcc9c029a218f0eb627e8c80eb9dafaabcf4cdb Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Wed, 31 Jul 2024 18:51:44 -0700 Subject: [PATCH] Remove redundant logic, just use max possible dynamic states --- src/Ryujinx.Graphics.Vulkan/PipelineState.cs | 32 ++------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs index f91ce407f..261decea8 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs @@ -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,