From 09b8095584c8449e8d1100a4af74870dac5e5098 Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Sun, 1 Sep 2024 19:21:44 -0700 Subject: [PATCH] Avoid changing feedback loop aspect if extension is not supported prevents failed pipeline compiles (or seemingly incompatible) --- src/Ryujinx.Graphics.Vulkan/PipelineBase.cs | 7 ++++++- src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs | 2 ++ src/Ryujinx.Graphics.Vulkan/PipelineState.cs | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index 9a46cb943e..a302f730f5 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -1721,6 +1721,11 @@ namespace Ryujinx.Graphics.Vulkan [MethodImpl(MethodImplOptions.AggressiveInlining)] private bool UpdateFeedbackLoop() { + if (!Gd.Capabilities.SupportsAttachmentFeedbackLoop) + { + return false; + } + List hazards = _descriptorSetUpdater.FeedbackLoopHazards; if ((hazards?.Count ?? 0) > 0) @@ -1765,7 +1770,7 @@ namespace Ryujinx.Graphics.Vulkan } // Stencil test being enabled doesn't necessarily mean a write, but it's not critical to check. - _passWritesDepthStencil |= (_newState.DepthTestEnable && _newState.DepthWriteEnable) || _newState.StencilTestEnable; + _passWritesDepthStencil |= _supportExtDynamic ? (DynamicState.DepthTestEnable && DynamicState.DepthWriteEnable) || _newState.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 822838f005..36bd1ff455 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs @@ -166,6 +166,8 @@ namespace Ryujinx.Graphics.Vulkan pipeline.DepthClampEnable = state.DepthClampEnable; + pipeline.FeedbackLoopAspects = FeedbackLoopAspects.None; + pipeline.DepthMode = state.DepthMode == DepthMode.MinusOneToOne; pipeline.HasDepthStencil = state.DepthStencilEnable; diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs index facb221abe..f447d0f20e 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs @@ -273,6 +273,8 @@ namespace Ryujinx.Graphics.Vulkan PolygonMode = PolygonMode.Fill; DepthBoundsTestEnable = false; + FeedbackLoopAspects = FeedbackLoopAspects.None; + _supportsExtDynamicState = supportsExtDynamicState; _supportsExtDynamicState2 = extendedDynamicState2;