diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index eec57b83d..05d2e5388 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -737,7 +737,7 @@ namespace Ryujinx.Graphics.Vulkan if (oldTopologyClass != newTopologyClass) { - _newState.Topology = oldTopology; + _newState.TopologyClass = oldTopology; } } else @@ -747,8 +747,9 @@ namespace Ryujinx.Graphics.Vulkan _newState.DepthTestEnable = oldDepthTestEnable; _newState.DepthWriteEnable = oldDepthWriteEnable; _newState.ViewportsCount = oldViewportsCount; - _newState.Topology = oldTopology; } + + _newState.Topology = oldTopology; DynamicState.SetViewports(ref oldViewports, oldViewportsCount); @@ -1102,17 +1103,19 @@ namespace Ryujinx.Graphics.Vulkan var vkTopology = Gd.TopologyRemap(topology).Convert(); var newTopologyClass = GetTopologyClass(vkTopology); - var currentTopologyClass = GetTopologyClass(_newState.Topology); + var currentTopologyClass = GetTopologyClass(_newState.TopologyClass); if (_supportExtDynamic) { DynamicState.SetPrimitiveTopology(vkTopology); } - if (!_supportExtDynamic || (currentTopologyClass != newTopologyClass)) + if ((currentTopologyClass != newTopologyClass)) { - _newState.Topology = vkTopology; + _newState.TopologyClass = vkTopology; } + + _newState.Topology = vkTopology; SignalStateChange(); } diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs index bf2be65ca..c7d4c5ffd 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs @@ -131,6 +131,8 @@ namespace Ryujinx.Graphics.Vulkan set => Internal.Id7 = (Internal.Id7 & 0xFFFFFFFFFFF0FFFF) | ((ulong)value << 16); } + public PrimitiveTopology TopologyClass; + public LogicOp LogicOp { readonly get => (LogicOp)((Internal.Id7 >> 20) & 0xF); @@ -437,6 +439,15 @@ namespace Ryujinx.Graphics.Vulkan Topology = Topology, }; + if (supportsExtDynamicState) + { + inputAssemblyState.Topology = TopologyClass; + } + else + { + inputAssemblyState.Topology = Topology; + } + var tessellationState = new PipelineTessellationStateCreateInfo { SType = StructureType.PipelineTessellationStateCreateInfo,