From 674288a71f242e851576156170139e438dc90e63 Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Mon, 12 Aug 2024 22:09:09 -0700 Subject: [PATCH] Avoid creating pipelines for each topology. --- src/Ryujinx.Graphics.Vulkan/PipelineBase.cs | 4 ++-- src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index a1c66de35..15220ddf7 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -671,7 +671,7 @@ namespace Ryujinx.Graphics.Vulkan { if (oldTopology.ConvertToClass() != _newState.Topology.ConvertToClass()) { - _newState.Topology = oldTopology; + _newState.Topology = oldTopology.ConvertToClass(); } DynamicState.SetCullMode(oldCullMode); @@ -1078,7 +1078,7 @@ namespace Ryujinx.Graphics.Vulkan if ((_newState.Topology.ConvertToClass() != newTopologyClass)) { - _newState.Topology = vkTopology; + _newState.Topology = vkTopology.ConvertToClass(); } DynamicState.SetPrimitiveTopology(vkTopology); diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs index 28241f5da..28ddfb292 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs @@ -218,7 +218,7 @@ namespace Ryujinx.Graphics.Vulkan pipeline.StencilBackDepthFailOp = extendedDynamicState ? 0 : state.StencilTest.BackDpFail.Convert(); pipeline.StencilBackCompareOp = extendedDynamicState ? 0 : state.StencilTest.BackFunc.Convert(); - pipeline.Topology = gd.TopologyRemap(state.Topology).Convert(); + pipeline.Topology = extendedDynamicState ? gd.TopologyRemap(state.Topology).Convert().ConvertToClass() : gd.TopologyRemap(state.Topology).Convert(); int vaCount = Math.Min(Constants.MaxVertexAttributes, state.VertexAttribCount); int vbCount = Math.Min(Constants.MaxVertexBuffers, state.VertexBufferCount);