Game: recover depth-bounds-enabled states in pipeline prebuild #3040
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!3040
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/3040/head"
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?
@fuzeofficlal on GitHub · 2026-11-26 04:57 UTC · original
fuzeofficlal:fix/game-pipelines-depth-bounds→main· +165 −18 · 1 files · 1 commits · closed without mergingProblem
crates/victory-game/src/pipelines.rsdocuments compact depth-stencil byte 15 asdepth-bounds testand serializesc[15]intoD3D12_DEPTH_STENCIL_DESC1.DepthBoundsTestEnableat offset0x34(whichvictory-gpunow honors on the host after #158).However, when
Named::findrecovers depth-stencil states not present in an SGD5 database:depth_from_registersreadsDB_DEPTH_CONTROLbits0..2,4..10, and20..22but skips bit 3 (DEPTH_BOUNDS_ENABLE), leavingb[15] = 0.depth_spacealso leavesb[15] = 0.As a result, any graphics pipeline in a shader pack whose depth-stencil state enables the depth bounds test misses both register recovery and fallback enumeration, so
Named::findfails to resolve its hash and prebuild skips it asUnnamed::DepthStencil.Fix
DB_DEPTH_CONTROLbit 3 (control >> 3 & 1) into compact byte 15 indepth_from_registers. Whendepth_onis false and bit 3 is clear, try both0and1(mirroring howdepth_on == falseenumerates depth enable/write/func in case the driver clearedDB_DEPTH_CONTROLwithout a depth target).b[15]in[0, 1]for the stencil-off loop indepth_space(+128 candidates, leaving the 2.5M stencil-on enumeration unchanged).Verification
cargo test --locked -p victory-game(17 passed, including new unit tests coveringdepth_from_registers,depth_space, and end-to-endNamed::find+streamrecovery of a depth-bounds-enabled graphics record with no databases)cargo test --locked -p victory(18 passed)cargo clippy --locked -p victory-game -p victory --all-targets -- -D warningsrustfmt --edition 2024 --check crates/victory-game/src/pipelines.rscargo xtask policy(191 files ok)@fuzeofficlal on GitHub · 2026-11-26 05:20 UTC · original
Note for maintainers: #3048 (stacked on #3047) also addresses
b[15]recovery indepth_from_registersalongsideb[14]and stencil fields (tryingb[15]in0..=1even whenDB_DEPTH_CONTROLbit 3 is clear). Happy to close this in favour of #3048 if the #3047/#3048 stack is preferred, or keep this as the standaloneb[15]+depth_spacepatch.@Marvisak on GitHub · 2026-11-26 06:15 UTC · original
Automated triage for the maintainers.
The gap is real. In
crates/victory-game/src/pipelines.rs,depth_from_registersanddepth_spacenever set compact byte 15 (the depth-bounds test), so a state with it set cannot be named. ReadingDB_DEPTH_CONTROLbit 3 asDEPTH_BOUNDS_ENABLEmatches the public register layout. Two things stand in the way of merging it as is:depth_from_registerstries onlyb[15] = 0. #3048 measuredshaders.rpfand reports the opposite: several descriptions set b14/b15 whileDEPTH_BOUNDS_ENABLEis clear, so it tries both values in every case. If that measurement holds, this PR still misses those states. Please give evidence for the rule (states from a shader pack it names that are otherwise unnamed), or try both values as #3048 does.depth_spaceenumeration ofb[15]. If that is worth keeping, a rebase on top of #3048 with a pack measurement showing that it names something would make this a clear, separate change.The tests use synthetic registers and a synthetic pack only, with no title data, which is fine.
Generated by Claude Code
@fuzeofficlal on GitHub · 2026-11-26 06:26 UTC · original
Closing in favour of #3048 (stacked on #3047), which already covers
b[15]indepth_from_registersunconditionally with measured shader-pack results.Pull request closed