Primitive Topolgy DynamicState maybe causing performance degredation.

This commit is contained in:
sunshineinabox 2024-05-13 00:18:20 -07:00
parent 5f02e28017
commit 24e6105e6f
4 changed files with 49 additions and 19 deletions

View file

@ -453,9 +453,13 @@ namespace Ryujinx.Graphics.Vulkan
{
SType = StructureType.PipelineInputAssemblyStateCreateInfo,
PrimitiveRestartEnable = primitiveRestartEnable,
Topology = Topology,
};
if (!supportsExtDynamicState)
{
inputAssemblyState.Topology = Topology;
}
var tessellationState = new PipelineTessellationStateCreateInfo
{
SType = StructureType.PipelineTessellationStateCreateInfo,
@ -593,7 +597,7 @@ namespace Ryujinx.Graphics.Vulkan
colorBlendState.PNext = &colorBlendAdvancedState;
}
int dynamicStatesCount = supportsExtDynamicState ? (isMoltenVk ? 14 : 15) : 7;
int dynamicStatesCount = supportsExtDynamicState ? (isMoltenVk ? 15 : 16) : 7;
DynamicState* dynamicStates = stackalloc DynamicState[dynamicStatesCount];
@ -617,6 +621,7 @@ namespace Ryujinx.Graphics.Vulkan
dynamicStates[index++] = DynamicState.DepthWriteEnable;
dynamicStates[index++] = DynamicState.DepthCompareOp;
dynamicStates[index++] = DynamicState.StencilTestEnable;
dynamicStates[index++] = DynamicState.PrimitiveTopology;
dynamicStates[index] = DynamicState.StencilOp;
}