From dc0dbc50abdaedfdcca05e5a5c1a5f26f70e3b79 Mon Sep 17 00:00:00 2001 From: cstamford Date: Sun, 28 May 2023 22:31:56 +0100 Subject: Add support for VK_EXT_depth_clip_control. (#5027) * Add support for VK_EXT_depth_clip_control. * Code review feedback Minor formatting Co-authored-by: gdkchan * Check .DepthClipControl to make sure the host actually supports the feature. * Review feedback: remove Vulkan platform switch, relying on QueryHostSupportsDepthClipControl to drive the behaviour - OpenGL returns true, and any future platforms that don't support the [-1, 1] depth mode can return false for the transformation. --------- Co-authored-by: gdkchan --- src/Ryujinx.Graphics.Vulkan/PipelineBase.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/Ryujinx.Graphics.Vulkan/PipelineBase.cs') diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs index ce6148e2..b4eccfbb 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -813,8 +813,12 @@ namespace Ryujinx.Graphics.Vulkan public void SetDepthMode(DepthMode mode) { - // Currently this is emulated on the shader, because Vulkan had no support for changing the depth mode. - // In the future, we may want to use the VK_EXT_depth_clip_control extension to change it here. + bool oldMode = _newState.DepthMode; + _newState.DepthMode = mode == DepthMode.MinusOneToOne; + if (_newState.DepthMode != oldMode) + { + SignalStateChange(); + } } public void SetDepthTest(DepthTestDescriptor depthTest) -- cgit v1.2.3