From a264d9273dd31419eb5b427d282cdcc52199688d Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Wed, 26 Jun 2024 17:38:23 +0100 Subject: [PATCH] Fix stencil clears --- src/Ryujinx.Graphics.Metal/HelperShader.cs | 3 +-- src/Ryujinx.Graphics.Metal/Shaders/DepthStencilClear.metal | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Ryujinx.Graphics.Metal/HelperShader.cs b/src/Ryujinx.Graphics.Metal/HelperShader.cs index 6f953a583..1387a5a35 100644 --- a/src/Ryujinx.Graphics.Metal/HelperShader.cs +++ b/src/Ryujinx.Graphics.Metal/HelperShader.cs @@ -309,7 +309,7 @@ namespace Ryujinx.Graphics.Metal // Save current state _pipeline.SaveState(); - const int ClearDepthBufferSize = 4; + const int ClearDepthBufferSize = 16; using var buffer = _renderer.BufferManager.ReserveOrCreate(_pipeline.Cbs, ClearDepthBufferSize); buffer.Holder.SetDataUnchecked(buffer.Offset, new ReadOnlySpan(ref depthValue)); @@ -328,7 +328,6 @@ namespace Ryujinx.Graphics.Metal _pipeline.SetProgram(_programDepthStencilClear); _pipeline.SetFaceCulling(false, Face.Front); - _pipeline.SetDepthTest(new DepthTestDescriptor(false, false, CompareOp.Always)); _pipeline.SetPrimitiveTopology(PrimitiveTopology.TriangleStrip); _pipeline.SetViewports(viewports); _pipeline.SetDepthTest(new DepthTestDescriptor(true, depthMask, CompareOp.Always)); diff --git a/src/Ryujinx.Graphics.Metal/Shaders/DepthStencilClear.metal b/src/Ryujinx.Graphics.Metal/Shaders/DepthStencilClear.metal index 0fb3bd858..4ee4f4a51 100644 --- a/src/Ryujinx.Graphics.Metal/Shaders/DepthStencilClear.metal +++ b/src/Ryujinx.Graphics.Metal/Shaders/DepthStencilClear.metal @@ -8,7 +8,6 @@ struct VertexOut { struct FragmentOut { float depth [[depth(any)]]; - uint stencil [[stencil]]; }; struct ClearDepth { @@ -38,7 +37,6 @@ fragment FragmentOut fragmentMain(VertexOut in [[stage_in]], FragmentOut out; out.depth = constant_buffers.clear_depth->data; - // out.stencil = stencil_clear; return out; }