From 908d555f8ebd973c7a8ce1df7d487a1a985c6ac0 Mon Sep 17 00:00:00 2001 From: sunshineinabox Date: Sat, 18 May 2024 22:14:38 -0700 Subject: [PATCH] Some more small changes --- src/Ryujinx.Graphics.Vulkan/PipelineBase.cs | 6 ++++-- src/Ryujinx.Graphics.Vulkan/PipelineState.cs | 8 ++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index 7908aa9e15..f9ec3d1638 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -901,7 +901,9 @@ namespace Ryujinx.Graphics.Vulkan public void SetDepthMode(DepthMode mode) { bool oldMode; - if (Gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne) + bool supportsDepthClipandDynamicState = Gd.Capabilities.SupportsDepthClipControl && + Gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne; + if (supportsDepthClipandDynamicState) { oldMode = DynamicState.DepthMode; DynamicState.SetDepthMode(mode == DepthMode.MinusOneToOne); @@ -912,7 +914,7 @@ namespace Ryujinx.Graphics.Vulkan _newState.DepthMode = mode == DepthMode.MinusOneToOne; } - if ((Gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne ? DynamicState.DepthMode : _newState.DepthMode) != oldMode) + if ((supportsDepthClipandDynamicState ? DynamicState.DepthMode : _newState.DepthMode) != oldMode) { SignalStateChange(); } diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs index ce3833d5b4..0dd3a97119 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineState.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineState.cs @@ -517,18 +517,14 @@ namespace Ryujinx.Graphics.Vulkan viewportState.ScissorCount = ScissorsCount; } - if (gd.Capabilities.SupportsDepthClipControl) + if (gd.Capabilities.SupportsDepthClipControl && !gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne) { var viewportDepthClipControlState = new PipelineViewportDepthClipControlCreateInfoEXT { SType = StructureType.PipelineViewportDepthClipControlCreateInfoExt, + NegativeOneToOne = DepthMode, }; - if (!gd.ExtendedDynamicState3Features.ExtendedDynamicState3DepthClipNegativeOneToOne) - { - viewportDepthClipControlState.NegativeOneToOne = DepthMode; - } - viewportState.PNext = &viewportDepthClipControlState; }