Game: try what depth-stencil registers do not keep (stacked on #3047) #3048
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3048
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3048"
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?
@zed6000 on GitHub · 2026-11-26 05:14 UTC · original
zed6000:pr-depth-registers→main· +222 −21 · 1 files · 2 commits · openThe depth-stencil half of #2930. Stacked on #3047: the first commit here is #3047's, and this PR's own change is the second commit (
1d5afa0). Once #3047 is in, only that commit remains.After rasterisers, the pre-build's largest named-state gap is 139 records (13 hashes) with
depth-stencil state not named. Comparingdepth_from_registers's candidates with the descriptions that do match shows three things the registers don't keep:DEPTH_BOUNDS_ENABLEis clear. Both are now tried as 0 and 1.DB_STENCILREFMASKholds 0 where the description has 0xFF (or the read mask). Both are tried.STENCIL_ENABLEclear,DB_DEPTH_CONTROL/DB_STENCIL_CONTROLstill hold the faces the engine's description names. They are tried next to the D3D12 default faces.depth_from_registersnow wraps the old body (depth_kept) and adds those variants. The face decoding moved tostencil_facesso both use it. The CityHash64 still decides.Measured on
shaders.rpf1.0.2.1 (offline, RX 7900 XTX):Named::findtakes ~88 ms.translate --cache --pipelinesskips 41 of 28,164 pipelines (main: 1,029): 3 depth-stencil, 3 blend, and the 35 shader causes. Every pipeline it made was created.cargo test -p victory-game18/0 (1 new test, on synthetic registers), and clippy clean.The 2 hashes still unnamed (3 records) have depth on and a stencil whose registers keep nothing it writes. A search over every op and func of both faces didn't match them, so they're left alone.
🤖 Generated with Claude Code
@Marvisak on GitHub · 2026-11-26 06:17 UTC · original
Automated triage for the maintainers.
Verdict: merge candidate, after #3047. The PR's first commit is #3047's. The only change of its own is
1d5afa0incrates/victory-game/src/pipelines.rs.depth_from_registersnow wraps the old body (renameddepth_kept) and also tries:DB_STENCIL_CONTROL/DB_DEPTH_CONTROLstill hold.The face decoding is moved unchanged into
stencil_faces. A candidate still counts only when its CityHash64 matches the record's, so the extra variants cannot name a wrong state. The search stays small, at most a few hundred candidates per register image.Note for the maintainer: #3040 also changes
depth_from_registersanddepth_spaceto recover the depth-bounds bit (b15), and the two will conflict textually. This PR covers b15 in the register path more broadly. #3040 also adds b15 to the enumeration and checks the stream output. Pick one, or rebase the other.CI:
checkpassing.Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 05:20 UTC · original · approved these changes
Static review of commit
1d5afa02(stacked on #3047) incrates/victory-game/src/pipelines.rs.depth_from_registerscleanly wrapsdepth_keptand tries the four combinations of(b[14], b[15]), the0xFF/ read-mask write-mask variants whenDB_STENCILREFMASKhas write mask 0 with stencil enabled, and the register-encoded stencil faces whenSTENCIL_ENABLEis clear. Trying(b[14], b[15])unconditionally also catches descriptions that enable depth bounds even whenDB_DEPTH_CONTROLbit 3 is clear, and CityHash64 remains the exact arbiter. Clean factoring viastencil_facesand clear unit tests.@kotekompotek on GitHub · 2026-11-26 05:27 UTC · original · approved these changes
Verified (delta over #3047):
stencil_facesis a faithful extraction of the inline decode (same control/stencil shifts, back=front when back-face stencil is off). The enumeration bounds at faces(≤2) × writes(≤3) × tail(4) = 24 candidates and covers exactly the non-kept fields the doc names: b14/b15, register-decoded faces under stencil-off, and write-mask alternatives under kept-0. The test discriminates each variant. 25,465 of 25,471 records named.@futurepro62 on GitHub · 2026-11-26 19:22 UTC · original
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
1d5afa0(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 869 passed, 0 failed, 10 ignored.a_rasteriser_reads_from_its_registers,a_record_names_its_rasteriser_from_the_register_image,depth_states_try_what_the_registers_do_not_keep.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.