From be78e7a1a5745333b42d5393e9109066f812ce97 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Thu, 20 Jun 2024 21:08:28 +0100 Subject: [PATCH] Fix FEZ not showing anything Does not fix the underlying shortcomings of the cache system --- src/Ryujinx.Graphics.Metal/EncoderState.cs | 1 - src/Ryujinx.Graphics.Metal/EncoderStateManager.cs | 4 ---- src/Ryujinx.Graphics.Metal/HelperShader.cs | 3 +-- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Ryujinx.Graphics.Metal/EncoderState.cs b/src/Ryujinx.Graphics.Metal/EncoderState.cs index 811c68995..f99f52aec 100644 --- a/src/Ryujinx.Graphics.Metal/EncoderState.cs +++ b/src/Ryujinx.Graphics.Metal/EncoderState.cs @@ -1,4 +1,3 @@ -using Ryujinx.Common.Memory; using Ryujinx.Graphics.GAL; using SharpMetal.Metal; using System.Linq; diff --git a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs index e6933eeb2..9919db5f2 100644 --- a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs +++ b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs @@ -485,10 +485,6 @@ namespace Ryujinx.Graphics.Metal // Inlineable public void UpdateStencilState(StencilTestDescriptor stencilTest) { - // Cleanup old state - _currentState.FrontFaceStencil.Dispose(); - _currentState.BackFaceStencil.Dispose(); - _currentState.FrontFaceStencil = new MTLStencilDescriptor { StencilFailureOperation = stencilTest.FrontSFail.Convert(), diff --git a/src/Ryujinx.Graphics.Metal/HelperShader.cs b/src/Ryujinx.Graphics.Metal/HelperShader.cs index b907173b6..0673a42c2 100644 --- a/src/Ryujinx.Graphics.Metal/HelperShader.cs +++ b/src/Ryujinx.Graphics.Metal/HelperShader.cs @@ -329,8 +329,7 @@ namespace Ryujinx.Graphics.Metal _pipeline.SetPrimitiveTopology(PrimitiveTopology.TriangleStrip); _pipeline.SetViewports(viewports); _pipeline.SetDepthTest(new DepthTestDescriptor(true, depthMask, CompareOp.Always)); - // TODO: Figure out why this causes a crash - // _pipeline.SetStencilTest(CreateStencilTestDescriptor(stencilMask != 0, stencilValue, 0xFF, stencilMask)); + _pipeline.SetStencilTest(CreateStencilTestDescriptor(stencilMask != 0, stencilValue, 0xFF, stencilMask)); _pipeline.GetOrCreateRenderEncoder(true).SetFragmentBytes(ptr, ClearDepthBufferSize, 0); _pipeline.Draw(4, 1, 0, 0);