upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/xma2_decoder.cpp
diff options
context:
space:
mode:
authorNotRexed <therealnothingfn@gmail.com>2026-11-27 12:18:18 -0500
committerNotRexed <therealnothingfn@gmail.com>2026-11-27 12:18:18 -0500
commitf3394041591abd1724141be545da7c2715bf7dbb (patch)
tree61390edb65ef69ac04a19295a1da30adac816840 /runtime/src/xma2_decoder.cpp
parentc8cb6f6778e3c7b6d1408fbfcdd5c1637ee1abe8 (diff)
Pixel programs can keep the console's early depth test (LEONIDA_EARLY_DEPTH=1, off by default)
What was wrong: a console pixel program whose DB_SHADER_CONTROL has DEPTH_BEFORE_SHADER (bit 12, HLSL's [earlydepthstencil]) was translated without it: the translator read the word and never used it. On the host such a program is tested after it runs wherever it writes unordered views or discards, and its writes to unordered views land for pixels the depth test then rejects. Counted over the 12,101 pixel programs of a work folder: 3,023 ask for the early test (0x1050 in 1,718, 0x1450 in 705, 0x1010 in 380, 0x1410 in 220), none of them writes depth or stencil. The 705 are the transparent passes' first programs (PS_AlphaPrepass, PS_PedAlphaPrepass, PS_BreakableGlassAlphaPrepass, ptfx_PS_AlphaPrepass, PS_Cable_AlphaPrepass). In the frame listing of run x2 (frame 1416), 42 draws of them store through two to four unordered views: two small integer images (640x360, 1280x720) and, the particles' apart, two of the picture's size, one of which PS_AlphaVelocityDepthResolve reads to write the scene's depth and motion vectors with the depth test "always". Glass behind a wall so gives the wall's pixels the depth of what lies behind them, for all that reads depth afterwards. The expected cause of the black squares at a glass door's foot; not shown in a run yet. What changes: with LEONIDA_EARLY_DEPTH=1 such a program declares DXIL's ForceEarlyDepthStencil (ShaderFlags bit 3), unless it writes depth or stencil. The switch joins the shader cache's key by itself (every LEONIDA_* name the translator reads does). The frame-256 log line says how many programs translated so far were given the early test, left late with the switch off, or left late as they write depth or stencil. Source: trustno1-coder/VIctory-NVIDIA 41b4a05, GPL-3.0 (hand port: the decision, the flag, the counts and both tests). myokex c3723f3 (in proneonn/Vertex) and kitty-core/Kitty6 (in LoverCatys/ruff-lab 4b5856a) declare the same flag, there without a switch or on by default. Off by default: not run on the game here. The translator's sources change, so every shader is translated again at the next start whatever the switch says. Tests: cargo test --profile diag -p leonida-shader --lib early_depth (2 tests; dxil.dll of the Windows SDK 10.0.26100.0 takes the flag); cargo check --profile diag -p leonida --features diagnostics. AI-assisted. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/xma2_decoder.cpp')
0 files changed, 0 insertions, 0 deletions