Recompiler: console pixel shaders tested depth-first keep early depth #2181
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2181
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2181"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@0xkn0wh3r3 on GitHub · 2026-11-25 08:09 UTC · original
0xkn0wh3r3:recomp/early-depth-before-shader→main· +117 −12 · 8 files · 1 commits · openA console pixel shader compiled with
[earlydepthstencil]runs withDB_SHADER_CONTROL.DEPTH_BEFORE_SHADER(bit 12) set, so the console tests depth and stencil before it runs and it runs only for pixels that pass, even when it writes memory. XCL never read the register: on PC such shaders ran for hidden pixels too and kept their memory writes. This reads the bit and gives those shaders early depth on both translation paths.What is in it
crates/xcl/src/gpu/recomp/mod.rs:ps_shader_controlreadsDB_SHADER_CONTROL, the dword afterSPI_PS_INPUT_ENAin the FSSM's PS input table (+0x114, plus the sub-version shift), into the newPsInterface::early_depth. It is read only whereps_input_tablerecognised the table.crates/xcl/src/gpu/recomp/emit.rs: such pixel shaders get[earlydepthstencil]onmain.crates/xcl/src/gpu/dxil/kernel.rs: the direct DXIL path passes the bit toStageInfo::Pixel(it was hard-coded tofalse), which sets ForceEarlyDepthStencil (shader flag bit 3).recomp::attribute_tests::ps_depth_before_shader_from_the_input_table(both table sub-versions, the bit alone and with other bits, no bit, no recognised table) anddxil::core_tests::early_depth_pixel_shaders_test_depth_first_on_both_paths(the HLSL attribute and the DXIL flag on both paths, with and without anSV_Depthexport; DXC accepts the two together). Both fail with the three runtime lines reverted. The other test code only gainsearly_depth: falsein 19PsInterfaceliterals.The translator's source id covers these files, so cached translations are made again.
Tested
dxil.dll.3913c6f(rebased on main2898511):cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1360 passed, 5 failed, 46 ignored, across every test binary (the lib's unit tests: 1281 passed, 5 failed, 26 ignored).main(2898511) on this machine:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0,1,2,3}(CreateComputePipelineState: out of memory, 0x8007000E, on the same seeds) andhle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory.no wave64; 3 per-lane-form checks refused by design (#1426 semantics);ir_text_assembles_signs_and_runs(no dxil.dll);pso_measurement_compiles_an_exact_synthetic_record(needs Developer Mode); the debug-layer title runs, dred off and on (no xgameruntime.dll);heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).Regression run
3913c6f): to be rerun after the rebase onto main2898511. The run of the pre-rebase head f0d7b14 (same title, 60 s) showed 1630 frames, no crash or device removal, peak commit 17418 MB.Not tested
DEPTH_BEFORE_SHADERset was not checked: the regression run shows nothing broke, not that the fix takes effect. The pre-rebase PR run showed more frames and a lower peak commit than themainrun, but that is one run each and is not claimed as an effect of this change.XCL_SAMPLE_*data here). It is the dword afterSPI_PS_INPUT_ENA, whose place the existing comment says was checked on three titles.runnerhas no depth-tested draw. The tests check the HLSL attribute and the DXIL flag, not the hardware's behaviour.AI use
@luckyteagirl on GitHub · 2026-11-25 08:36 UTC · original
Independent native Windows check of exact head
f0d7b14ff3c5016f58fdc0c4fc18602e94bc731a(base568e7db7729c8fa6c8f0f4b32d798faaf11462bb), clean worktree.Environment: Windows 11 build 26200, Ryzen 9 5980HX, Radeon RX 6800M driver
30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5. I set the matchingXCL_DXC_DIRandXCL_REQUIRE_GPU=wave64.Focused tests: Both
cargo test --locked -p xcl --lib -j 2 <filter> -- --test-threads=1 --show-outputruns passed with 1 passed, 0 failed, 0 ignored each and noSKIPPEDnotices:ps_depth_before_shader_from_the_input_table: verifies the DB_SHADER_CONTROL bit extraction across the table sub-versions and absent-table cases.early_depth_pixel_shaders_test_depth_first_on_both_paths: validates the HLSL attribute and direct-DXIL early-depth flag with this DXC/DXIL version, including the depth-export case exercised by the test.Scope: These are translation and shader-compiler tests. They do not create a depth-tested GPU draw or prove that hidden pixels suppress memory writes on the RX 6800M. I did not run the full workspace suite or a retail-title smoke on this branch.
AI use: OpenAI Codex reviewed the changed translation paths, ran the two focused tests, checked the logs and exact revision, and prepared this report.
@DavidM1911 on GitHub · 2026-11-25 15:39 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@DavidM1911 on GitHub · 2026-11-26 08:15 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.