From aa0913838d1f3d113324a512a417542ffe08ddbc Mon Sep 17 00:00:00 2001 From: gdk Date: Sun, 13 Feb 2022 21:53:23 -0300 Subject: [PATCH] SPIR-V: Set DepthReplacing execution mode when FragDepth is modified --- Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvGenerator.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvGenerator.cs b/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvGenerator.cs index 203226338..1a2157f24 100644 --- a/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvGenerator.cs +++ b/Ryujinx.Graphics.Shader/CodeGen/Spirv/SpirvGenerator.cs @@ -102,6 +102,11 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv context.AddExecutionMode(spvFunc, context.Config.Options.TargetApi == TargetApi.Vulkan ? ExecutionMode.OriginUpperLeft : ExecutionMode.OriginLowerLeft); + + if (context.Outputs.ContainsKey(AttributeConsts.FragmentOutputDepth)) + { + context.AddExecutionMode(spvFunc, ExecutionMode.DepthReplacing); + } } else if (context.Config.Stage == ShaderStage.Compute) {