Fix stencil clears

This commit is contained in:
Isaac Marovitz 2024-06-26 17:38:23 +01:00 committed by Isaac Marovitz
parent 05189c7749
commit a264d9273d
2 changed files with 1 additions and 4 deletions

View file

@ -309,7 +309,7 @@ namespace Ryujinx.Graphics.Metal
// Save current state // Save current state
_pipeline.SaveState(); _pipeline.SaveState();
const int ClearDepthBufferSize = 4; const int ClearDepthBufferSize = 16;
using var buffer = _renderer.BufferManager.ReserveOrCreate(_pipeline.Cbs, ClearDepthBufferSize); using var buffer = _renderer.BufferManager.ReserveOrCreate(_pipeline.Cbs, ClearDepthBufferSize);
buffer.Holder.SetDataUnchecked(buffer.Offset, new ReadOnlySpan<float>(ref depthValue)); buffer.Holder.SetDataUnchecked(buffer.Offset, new ReadOnlySpan<float>(ref depthValue));
@ -328,7 +328,6 @@ namespace Ryujinx.Graphics.Metal
_pipeline.SetProgram(_programDepthStencilClear); _pipeline.SetProgram(_programDepthStencilClear);
_pipeline.SetFaceCulling(false, Face.Front); _pipeline.SetFaceCulling(false, Face.Front);
_pipeline.SetDepthTest(new DepthTestDescriptor(false, false, CompareOp.Always));
_pipeline.SetPrimitiveTopology(PrimitiveTopology.TriangleStrip); _pipeline.SetPrimitiveTopology(PrimitiveTopology.TriangleStrip);
_pipeline.SetViewports(viewports); _pipeline.SetViewports(viewports);
_pipeline.SetDepthTest(new DepthTestDescriptor(true, depthMask, CompareOp.Always)); _pipeline.SetDepthTest(new DepthTestDescriptor(true, depthMask, CompareOp.Always));

View file

@ -8,7 +8,6 @@ struct VertexOut {
struct FragmentOut { struct FragmentOut {
float depth [[depth(any)]]; float depth [[depth(any)]];
uint stencil [[stencil]];
}; };
struct ClearDepth { struct ClearDepth {
@ -38,7 +37,6 @@ fragment FragmentOut fragmentMain(VertexOut in [[stage_in]],
FragmentOut out; FragmentOut out;
out.depth = constant_buffers.clear_depth->data; out.depth = constant_buffers.clear_depth->data;
// out.stencil = stencil_clear;
return out; return out;
} }