From 087bf71a139ebf57a4113f30aa34e76bf6a4a7af Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Wed, 22 May 2024 20:27:37 -0400 Subject: [PATCH] FragmentOutputDepth Fixes --- src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs | 3 +++ src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/IoMap.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs index deb5dc394..72f60c04f 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs @@ -219,6 +219,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl { IoVariable.Position => "float4", IoVariable.PointSize => "float", + IoVariable.FragmentOutputDepth => "float", _ => GetVarTypeName(context, context.Definitions.GetUserDefinedType(ioDefinition.Location, isOutput: true)) }; string name = ioDefinition.IoVariable switch @@ -226,6 +227,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl IoVariable.Position => "position", IoVariable.PointSize => "point_size", IoVariable.FragmentOutputColor => $"color{ioDefinition.Location}", + IoVariable.FragmentOutputDepth => "depth", _ => $"{DefaultNames.OAttributePrefix}{ioDefinition.Location}" }; string suffix = ioDefinition.IoVariable switch @@ -234,6 +236,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl IoVariable.PointSize => "[[point_size]]", IoVariable.UserDefined => $"[[user(loc{ioDefinition.Location})]]", IoVariable.FragmentOutputColor => $"[[color({ioDefinition.Location})]]", + IoVariable.FragmentOutputDepth => "[[depth(any)]]", _ => "" }; diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/IoMap.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/IoMap.cs index edc907712..d0c198904 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/IoMap.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/IoMap.cs @@ -21,7 +21,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions IoVariable.BaseVertex => ("base_vertex", AggregateType.S32), IoVariable.ClipDistance => ("clip_distance", AggregateType.Array | AggregateType.FP32), IoVariable.FragmentOutputColor => ($"out.color{location}", AggregateType.Vector4 | AggregateType.FP32), - IoVariable.FragmentOutputDepth => ("depth", AggregateType.FP32), + IoVariable.FragmentOutputDepth => ("out.depth", AggregateType.FP32), IoVariable.FrontFacing => ("front_facing", AggregateType.Bool), IoVariable.InstanceId => ("instance_id", AggregateType.S32), IoVariable.PointCoord => ("point_coord", AggregateType.Vector2),