From da11dc1288f7bc08dd72e4d3b99c5b649e9ed671 Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Wed, 31 Jul 2024 17:12:57 -0700 Subject: [PATCH] Only pass Tesselation state create info if dynamic state is not supported --- src/Ryujinx.Graphics.Vulkan/PipelineState.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs index a281631d2..f91ce407f 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs @@ -427,13 +427,11 @@ namespace Ryujinx.Graphics.Vulkan Topology = supportsExtDynamicState ? TopologyClass : Topology, }; - var tessellationState = new PipelineTessellationStateCreateInfo - { - SType = StructureType.PipelineTessellationStateCreateInfo, - }; + PipelineTessellationStateCreateInfo tessellationState; if (!gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints) { + tessellationState.SType = StructureType.PipelineTessellationStateCreateInfo; tessellationState.PatchControlPoints = PatchControlPoints; } @@ -663,7 +661,6 @@ namespace Ryujinx.Graphics.Vulkan PStages = Stages.Pointer, PVertexInputState = &vertexInputState, PInputAssemblyState = &inputAssemblyState, - PTessellationState = &tessellationState, PViewportState = &viewportState, PRasterizationState = &rasterizationState, PMultisampleState = &multisampleState, @@ -674,6 +671,11 @@ namespace Ryujinx.Graphics.Vulkan RenderPass = renderPass, }; + if (!gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints) + { + pipelineCreateInfo.PTessellationState = &tessellationState; + } + Result result = gd.Api.CreateGraphicsPipelines(device, cache, 1, &pipelineCreateInfo, null, &pipelineHandle); if (throwOnError)