From 2483b1a52ab02fe5bf1cd3ce89dd32673a875482 Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Sat, 18 May 2024 16:06:21 -0700 Subject: [PATCH] Enable VK_EXT_extended_dynamic_state3 this time without seizures. --- .../PipelineDynamicState.cs | 30 +++++++++++-------- .../VulkanInitialization.cs | 8 +---- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineDynamicState.cs b/src/Ryujinx.Graphics.Vulkan/PipelineDynamicState.cs index 303633df0f..94bb9e1753 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineDynamicState.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineDynamicState.cs @@ -79,13 +79,14 @@ namespace Ryujinx.Graphics.Vulkan RasterDiscard = 1 << 11, LogicOp = 1 << 12, DepthClampEnable = 1 << 13, - LogicOpEnalbe = 1 << 14, + LogicOpEnable = 1 << 14, AlphaToCover = 1 << 15, AlphaToOne = 1 << 16, PatchControlPoints = 1 << 17, Standard = Blend | DepthBias | Scissor | Stencil | Viewport | LineWidth, Extended = CullMode | FrontFace | DepthTestBool | DepthTestCompareOp | StencilTestEnable, Extended2 = RasterDiscard | LogicOp | PatchControlPoints, + Extended3 = DepthClampEnable | LogicOpEnable | AlphaToCover | AlphaToOne, } private DirtyFlags _dirty; @@ -284,7 +285,7 @@ namespace Ryujinx.Graphics.Vulkan if (_logicOpEnable != logicOpEnable) { _logicOpEnable = logicOpEnable; - _dirty |= DirtyFlags.LogicOpEnalbe; + _dirty |= DirtyFlags.LogicOpEnable; } } @@ -328,7 +329,12 @@ namespace Ryujinx.Graphics.Vulkan { _dirty = DirtyFlags.Standard | DirtyFlags.Extended | DirtyFlags.Extended2; } - + + if (gd.Capabilities.SupportsExtendedDynamicState3) + { + _dirty = DirtyFlags.Standard | DirtyFlags.Extended | DirtyFlags.Extended2 | DirtyFlags.Extended3; + } + if (gd.IsMoltenVk) { _dirty &= ~DirtyFlags.LineWidth; @@ -344,24 +350,24 @@ namespace Ryujinx.Graphics.Vulkan _dirty &= ~DirtyFlags.LogicOp; } - if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToCoverageEnable) + if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToCoverageEnable) { - _dirty = DirtyFlags.AlphaToCover; + _dirty &= ~DirtyFlags.AlphaToCover; } - if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToOneEnable) + if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3AlphaToOneEnable) { - _dirty = DirtyFlags.AlphaToOne; + _dirty &= ~DirtyFlags.AlphaToOne; } - if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClampEnable) + if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClampEnable) { - _dirty = DirtyFlags.DepthClampEnable; + _dirty &= ~DirtyFlags.DepthClampEnable; } - if (gd.ExtendedDynamicState3Features.ExtendedDynamicState3LogicOpEnable) + if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3LogicOpEnable) { - _dirty = DirtyFlags.LogicOpEnalbe; + _dirty &= ~DirtyFlags.LogicOpEnable; } } @@ -437,7 +443,7 @@ namespace Ryujinx.Graphics.Vulkan RecordPatchControlPoints(gd, commandBuffer); } - if (_dirty.HasFlag(DirtyFlags.LogicOpEnalbe)) + if (_dirty.HasFlag(DirtyFlags.LogicOpEnable)) { RecordLogicOpEnable(gd, commandBuffer); } diff --git a/src/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs b/src/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs index 3446941ab2..1c8b675dcd 100644 --- a/src/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs +++ b/src/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs @@ -24,6 +24,7 @@ namespace Ryujinx.Graphics.Vulkan ExtConditionalRendering.ExtensionName, ExtExtendedDynamicState.ExtensionName, ExtExtendedDynamicState2.ExtensionName, + ExtExtendedDynamicState3.ExtensionName, ExtTransformFeedback.ExtensionName, KhrDrawIndirectCount.ExtensionName, KhrPushDescriptor.ExtensionName, @@ -497,13 +498,6 @@ namespace Ryujinx.Graphics.Vulkan pExtendedFeatures = &featuresExtendedDynamicState3; } - //Need To Enable the extension, once this is fixed - supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3DepthClampEnable = false; - supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3LogicOpEnable = false; - supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3AlphaToCoverageEnable = false; - supportedFeaturesExtExtendedDynamicState3.ExtendedDynamicState3LogicOpEnable = false; - - extendedDynamicState3Features = supportedFeaturesExtExtendedDynamicState3; var featuresVk11 = new PhysicalDeviceVulkan11Features