From db8afbb3a9063a64ba0ae3e843a038c104a7bcda Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Oct 2026 15:16:25 +0000 Subject: [PATCH] Don't write depth while the Z compare is off On the hardware (and in Dolphin) GXSetZMode with the compare disabled leaves the Z buffer alone even when the update bit is set. Aurora still wrote depth, so a full-screen quad drawn that way (the darkening during Stormship's lightning, for one) marked the whole screen nearest and every depth-tested draw after it failed until it faded. Ported from BlackAndBlue95/Strikers-WiiCompiled 369ec992. The pipeline cache key already includes depthUpdate, so no cache version bump. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_018NKSMYZU43wUfYtm1sxGsC --- aurora-main/lib/gx/gx.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aurora-main/lib/gx/gx.cpp b/aurora-main/lib/gx/gx.cpp index 3c74cb6..d4c0e4d 100644 --- a/aurora-main/lib/gx/gx.cpp +++ b/aurora-main/lib/gx/gx.cpp @@ -1910,7 +1910,8 @@ void populate_pipeline_config(PipelineConfig& config, GXPrimitive primitive, GXV config.pixelFmt = g_gxState.pixelFmt; config.dstAlpha = effective_dst_alpha(g_gxState.pixelFmt, g_gxState.alphaUpdate, g_gxState.dstAlpha); config.depthCompare = g_gxState.depthCompare; - config.depthUpdate = g_gxState.depthUpdate; + // As on the hardware (and in Dolphin): with the Z compare off, the Z buffer isn't updated either. + config.depthUpdate = g_gxState.depthCompare && g_gxState.depthUpdate; config.alphaUpdate = effective_alpha_update(g_gxState.pixelFmt, g_gxState.alphaUpdate); config.colorUpdate = g_gxState.colorUpdate; }