diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index 2b75d2753..a1c66de35 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -1105,6 +1105,8 @@ namespace Ryujinx.Graphics.Vulkan _newState.HasTessellationControlShader = internalProgram.HasTessellationControlShader; _newState.StagesCount = (uint)stages.Length; + _newState.Topology = internalProgram.ShaderTopology; + stages.CopyTo(_newState.Stages.AsSpan()[..stages.Length]); SignalStateChange(); diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs index 75a6674a3..28241f5da 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs @@ -218,9 +218,7 @@ namespace Ryujinx.Graphics.Vulkan pipeline.StencilBackDepthFailOp = extendedDynamicState ? 0 : state.StencilTest.BackDpFail.Convert(); pipeline.StencilBackCompareOp = extendedDynamicState ? 0 : state.StencilTest.BackFunc.Convert(); - var vkTopology = gd.TopologyRemap(state.Topology).Convert(); - - pipeline.Topology = extendedDynamicState ? vkTopology.ConvertToClass() : vkTopology; + pipeline.Topology = gd.TopologyRemap(state.Topology).Convert(); int vaCount = Math.Min(Constants.MaxVertexAttributes, state.VertexAttribCount); int vbCount = Math.Min(Constants.MaxVertexBuffers, state.VertexBufferCount); diff --git a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs index 5338030d9..821a3cbce 100644 --- a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs +++ b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; +using PrimitiveTopology = Silk.NET.Vulkan.PrimitiveTopology; namespace Ryujinx.Graphics.Vulkan { @@ -23,6 +24,8 @@ namespace Ryujinx.Graphics.Vulkan public bool IsCompute { get; } public bool HasTessellationControlShader => (Stages & (1u << 3)) != 0; + public PrimitiveTopology ShaderTopology; + public bool UpdateTexturesWithoutTemplate { get; } public uint Stages { get; } @@ -551,6 +554,8 @@ namespace Ryujinx.Graphics.Vulkan PipelineState pipeline = _state.ToVulkanPipelineState(_gd); + ShaderTopology = pipeline.Topology; + // Copy the shader stage info to the pipeline. var stages = pipeline.Stages.AsSpan();