A console pixel program whose DB_SHADER_CONTROL has DEPTH_BEFORE_SHADER
(bit 12, HLSL's [earlydepthstencil]) is translated with DXIL's
ForceEarlyDepthStencil flag when VICTORY_EARLY_DEPTH=1. The translator read
DB_SHADER_CONTROL but never used it, so every such program ran with the late
test on the host wherever it writes unordered views or discards, and its
writes to unordered views landed for pixels the depth test then rejected.
What that broke (capture C:\dev\captures\haze2, a character's head in front
of a window): the transparent pass (list 247; pixel programs
629743ca412296d4, 8ba01719b71d1d35, 5436c45060d74ebe and others,
DB_SHADER_CONTROL 0x1450) keeps the nearest transparent depth and its
velocity with 64-bit atomics in texture 46225 (R32G32, 1706x960); draw
271:34 (pixel 00ae3e9b98a0ae26, depth test ALWAYS, depth write on) writes
that depth into the scene depth 6481 and that velocity into the motion
vectors 38269 wherever it holds one. The glass, behind the head, wrote
there too: at the head's pixels in front of it the scene depth that the
heat-haze and in-scattering pass 731a39171b568298 (279:303) reads holds the
glass's (0.176, 0.85 m, for the head's 0.39, 0.38 m) and the motion vectors
hold the glass's velocity (-24, +31 where the head's own is +43, +35).
13.7% of that frame's transparent texels lie behind the opaque depth. The
haze pass picks heat haze (beyond 20 m) and in-scattering (beyond 137 m
there) by each pixel's distance, in 16x16 tiles: where the false depth is
far, it works on character outlines (expected cause of the blocks on hair,
not yet confirmed in a run).
The switch joins the shader cache's key only while it is on, so the default
translation and its cache entries stay as they were. Counted at the shader
cache's log line: programs given the early test, left late (switch off),
left late as they write depth or stencil. Tests: the decision, and a pixel
program translated with and without the switch (dxil.dll validates it).
Co-Authored-By: Claude Opus 5.5 <[email protected]>