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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018NKSMYZU43wUfYtm1sxGsC
This commit is contained in:
Claude committed 2026-10-05 15:16:25 +00:00
1 parent 755fb0e332
commit db8afbb3a9
1 file changed
+2 -1
+2 -1
View File
@@ -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;
}