Skip to content

Commit

Permalink
explicitly setup hash member variables
Browse files Browse the repository at this point in the history
  • Loading branch information
SamoZ256 committed Nov 23, 2024
1 parent 842634e commit d2ff55d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/renderer_mtl/renderer_mtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,11 @@ void RendererMTL::drawVertices(PICA::PrimType primType, std::span<const PICA::Ve
const u8 depthFunc = Helpers::getBits<4, 3>(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<Metal::DepthStencilRenderTarget> depthStencilRenderTarget = std::nullopt;
Expand Down Expand Up @@ -485,9 +487,12 @@ void RendererMTL::drawVertices(PICA::PrimType primType, std::span<const PICA::Ve
depthUniforms.depthMapEnable = regs[PICA::InternalRegs::DepthmapEnable] & 1;

// -------- Pipeline --------
Metal::DrawPipelineHash pipelineHash{colorRenderTarget->format, 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;
Expand Down

0 comments on commit d2ff55d

Please sign in to comment.