From a7409e6fba8e3f78b2fe8cc356d3ad21f13423ce Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Mon, 2 Sep 2024 12:40:29 -0700 Subject: [PATCH] Some missed changes --- src/Ryujinx.Graphics.Vulkan/EnumConversion.cs | 4 +-- src/Ryujinx.Graphics.Vulkan/PipelineBase.cs | 27 +++++++++---------- .../PipelineConverter.cs | 5 +++- .../PipelineDynamicState.cs | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Ryujinx.Graphics.Vulkan/EnumConversion.cs b/src/Ryujinx.Graphics.Vulkan/EnumConversion.cs index 7e5207d39..babcf992c 100644 --- a/src/Ryujinx.Graphics.Vulkan/EnumConversion.cs +++ b/src/Ryujinx.Graphics.Vulkan/EnumConversion.cs @@ -323,9 +323,9 @@ namespace Ryujinx.Graphics.Vulkan PrimitiveTopology.TriangleStrip or PrimitiveTopology.TriangleFan or PrimitiveTopology.TriangleListWithAdjacency or - PrimitiveTopology.TriangleStripWithAdjacency => PrimitiveTopology.TriangleList, + PrimitiveTopology.TriangleStripWithAdjacency => PrimitiveTopology.TriangleStrip, PrimitiveTopology.PatchList => PrimitiveTopology.PatchList, - _ => LogInvalidAndReturn(topology, nameof(PrimitiveTopology), PrimitiveTopology.TriangleList), + _ => LogInvalidAndReturn(topology, nameof(PrimitiveTopology), PrimitiveTopology.TriangleStrip), }; } diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index 4fa591ced..cb00aaf18 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -644,7 +644,7 @@ namespace Ryujinx.Graphics.Vulkan var oldStencilTestEnable = _supportExtDynamic ? DynamicState.StencilTestEnable : _newState.StencilTestEnable; var oldDepthTestEnable = _supportExtDynamic ? DynamicState.DepthTestEnable : _newState.DepthTestEnable; var oldDepthWriteEnable = _supportExtDynamic ? DynamicState.DepthWriteEnable : _newState.DepthWriteEnable; - var oldTopology = _supportExtDynamic ? DynamicState._topology : _newState.Topology; + var oldTopology = _newState.Topology; var oldViewports = DynamicState.Viewports; var oldViewportsCount = _supportExtDynamic ? DynamicState.ViewportsCount : _newState.ViewportsCount; @@ -825,11 +825,6 @@ namespace Ryujinx.Graphics.Vulkan public void SetDepthBias(PolygonModeMask enables, float factor, float units, float clamp) { - if (factor == 0 && units == 0 && !_newState.DepthBiasEnable && !_supportExtDynamic2) - { - return; - } - bool depthBiasEnable = (enables != 0) && (factor != 0 && units != 0); bool changed = false; @@ -882,7 +877,10 @@ namespace Ryujinx.Graphics.Vulkan if (_supportExtDynamic) { DynamicState.SetDepthTestBool(depthTest.TestEnable, depthTest.WriteEnable); - DynamicState.SetDepthTestCompareOp(depthTest.TestEnable ? depthTest.Func.Convert() : default); + if (depthTest.TestEnable) + { + DynamicState.SetDepthTestCompareOp(depthTest.Func.Convert()); + } } else { @@ -899,7 +897,7 @@ namespace Ryujinx.Graphics.Vulkan { if (_supportExtDynamic) { - DynamicState.SetCullMode(enable ? face.Convert() : default); + DynamicState.SetCullMode(enable ? face.Convert() : CullModeFlags.None); } else { @@ -977,7 +975,11 @@ namespace Ryujinx.Graphics.Vulkan if (Gd.Capabilities.SupportsExtendedDynamicState2.ExtendedDynamicState2LogicOp) { - DynamicState.SetLogicOp(logicOpEnable ? op.Convert() : default); + if (logicOpEnable) + { + DynamicState.SetLogicOp(op.Convert()); + } + } else { @@ -998,11 +1000,6 @@ namespace Ryujinx.Graphics.Vulkan public void SetPatchParameters(int vertices, ReadOnlySpan defaultOuterLevel, ReadOnlySpan defaultInnerLevel) { - if (vertices == 0 || vertices > Gd.Capabilities.MaxTessellationPatchSize) - { - return; - } - if (Gd.Capabilities.SupportsExtendedDynamicState2.ExtendedDynamicState2PatchControlPoints) { DynamicState.SetPatchControlPoints((uint)vertices); @@ -1770,7 +1767,7 @@ namespace Ryujinx.Graphics.Vulkan } // Stencil test being enabled doesn't necessarily mean a write, but it's not critical to check. - _passWritesDepthStencil |= _supportExtDynamic ? (DynamicState.DepthTestEnable && DynamicState.DepthWriteEnable) || _newState.StencilTestEnable : (_newState.DepthTestEnable && _newState.DepthWriteEnable) || _newState.StencilTestEnable; + _passWritesDepthStencil |= _supportExtDynamic ? (DynamicState.DepthTestEnable && DynamicState.DepthWriteEnable) || DynamicState.StencilTestEnable : (_newState.DepthTestEnable && _newState.DepthWriteEnable) || _newState.StencilTestEnable; } private bool RecreateGraphicsPipelineIfNeeded() diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs index c45b0fd13..f1423fd09 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs @@ -166,7 +166,10 @@ namespace Ryujinx.Graphics.Vulkan pipeline.DepthClampEnable = state.DepthClampEnable; - pipeline.FeedbackLoopAspects = FeedbackLoopAspects.None; + if (gd.Capabilities.SupportsDynamicAttachmentFeedbackLoop || !gd.Capabilities.SupportsAttachmentFeedbackLoop) + { + pipeline.FeedbackLoopAspects = FeedbackLoopAspects.None; + } pipeline.DepthMode = state.DepthMode == DepthMode.MinusOneToOne; diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineDynamicState.cs b/src/Ryujinx.Graphics.Vulkan/PipelineDynamicState.cs index 1e252cdef..66dfc1b3e 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineDynamicState.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineDynamicState.cs @@ -56,7 +56,7 @@ namespace Ryujinx.Graphics.Vulkan private uint _patchControlPoints; - public PrimitiveTopology _topology; + private PrimitiveTopology _topology; private bool _primitiveRestartEnable;