From fb964b514c162539bd6a9f56d19e0ca7ca6a4c26 Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Wed, 31 Jul 2024 08:14:26 -0700 Subject: [PATCH] Do not set patch control points dynamic state if there is no tessalation control shader. Thank you riperiperi --- src/Ryujinx.Graphics.Vulkan/PipelineBase.cs | 2 +- src/Ryujinx.Graphics.Vulkan/PipelineState.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index d001c46e6..b1dce459e 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -994,7 +994,7 @@ namespace Ryujinx.Graphics.Vulkan public void SetPatchParameters(int vertices, ReadOnlySpan defaultOuterLevel, ReadOnlySpan defaultInnerLevel) { - if (Gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints) + if (Gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints && _newState.HasTessellationControlShader) { DynamicState.SetPatchControlPoints((uint)vertices); } diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs index ddbe50f8a..1c83cc16d 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs @@ -432,7 +432,7 @@ namespace Ryujinx.Graphics.Vulkan SType = StructureType.PipelineTessellationStateCreateInfo, }; - if (!gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints) + if (!gd.ExtendedDynamicState2Features.ExtendedDynamicState2) { tessellationState.PatchControlPoints = PatchControlPoints; } @@ -587,7 +587,7 @@ namespace Ryujinx.Graphics.Vulkan { additionalDynamicStatesCount++; } - if (gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints) + if (gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints && HasTessellationControlShader) { additionalDynamicStatesCount++; } @@ -642,7 +642,7 @@ namespace Ryujinx.Graphics.Vulkan { dynamicStates[currentIndex++] = DynamicState.LogicOpExt; } - if (gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints) + if (gd.ExtendedDynamicState2Features.ExtendedDynamicState2PatchControlPoints && HasTessellationControlShader) { dynamicStates[currentIndex++] = DynamicState.PatchControlPointsExt; }