From c35304e4858ee45dd372c0bdbe82cd5497c49d34 Mon Sep 17 00:00:00 2001 From: SamoZ256 <96914946+SamoZ256@users.noreply.github.com> Date: Sat, 23 Nov 2024 20:17:19 +0100 Subject: [PATCH] explicitly setup hash member variables (#645) --- src/core/renderer_mtl/renderer_mtl.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/core/renderer_mtl/renderer_mtl.cpp b/src/core/renderer_mtl/renderer_mtl.cpp index df1f8b474..9cf587166 100644 --- a/src/core/renderer_mtl/renderer_mtl.cpp +++ b/src/core/renderer_mtl/renderer_mtl.cpp @@ -455,9 +455,11 @@ void RendererMTL::drawVertices(PICA::PrimType primType, std::span(depthControl); const u8 colorMask = Helpers::getBits<8, 4>(depthControl); - Metal::DepthStencilHash depthStencilHash{false, 1}; + Metal::DepthStencilHash depthStencilHash; depthStencilHash.stencilConfig = regs[PICA::InternalRegs::StencilTest]; depthStencilHash.stencilOpConfig = regs[PICA::InternalRegs::StencilOp]; + depthStencilHash.depthStencilWrite = false; + depthStencilHash.depthFunc = 1; const bool stencilEnable = Helpers::getBit<0>(depthStencilHash.stencilConfig); std::optional depthStencilRenderTarget = std::nullopt; @@ -485,9 +487,12 @@ void RendererMTL::drawVertices(PICA::PrimType primType, std::spanformat, DepthFmt::Unknown1}; + Metal::DrawPipelineHash pipelineHash; + pipelineHash.colorFmt = colorRenderTarget->format; if (depthStencilRenderTarget) { pipelineHash.depthFmt = depthStencilRenderTarget->format; + } else { + pipelineHash.depthFmt = DepthFmt::Unknown1; } pipelineHash.fragHash.lightingEnabled = regs[0x008F] & 1; pipelineHash.fragHash.lightingNumLights = regs[0x01C2] & 0x7;