Shaders: the level of detail of an array texture takes no slice (3 programs) #720
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!720
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/720/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?
@JRamos1993 on GitHub · 2026-11-25 05:38 UTC · original
JRamos1993:lod-array-coords→main· +160 −1 · 3 files · 1 commits · closed without mergingPart of #279.
Problem
3 pixel programs of the retail shader pack fail validation with
out of bound coord must be undef. Their draws are dropped.All three take the level of detail of a 2D array texture (
image_get_lod,dim:SQ_RSRC_IMG_2D_ARRAY). The lowering passedcalculateLODall three coordinates, so the array slice went in ascoord2. A level of detail only uses the spatial coordinates, and the validator wants the rest undefined. (The samples of the same texture in those programs pass the slice correctly.)What
lower,image, op 81:calculateLODtakes the coordinates up tospatial, which iscoordsminus the slice of a 1D or 2D array; the others areundef. For every other texture kind they already were, sincecsstarts asundef.the_level_of_detail_of_a_2d_array_takes_no_slice, a synthetic pixel program withimage_get_lodof a 2D array from a table. It emits, validates, and makes a pipeline on hardware and WARP. Without the change it fails with the same validator error as the title's programs.Tested
RTX 5090, driver 621.24, Windows 11,
main310c6eb.victory translate --validate --list:--pipelineson the 3 creates 3 pipelines, 0 refused.cargo test -p victory-shader --locked --no-fail-fast -- --test-threads=4: 215 passed, 0 failed, 3 ignored.cargo clippy -p victory-shader --all-targets --locked -- -D warnings, with and without--all-features: clean.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4: 511 passed, 0 failed, 9 ignored.Not tested
AI use
Claude Code with Claude Opus 5.5 found the failure on the retail pack, wrote the change and the test, ran the checks above and wrote this. The test uses a synthetic program. The title's shaders were only read on my machine, and nothing from them is in this PR.
`image_get_lod` was lowered to `calculateLOD` with three coordinates whatever the texture, so on a 2D array the slice went in as the third. The validator refuses that ("out of bound coord must be undef"): 3 pixel programs of the retail pack stopped there. The coordinates past the spatial ones are now undefined; for every other texture they already were. A test emits `image_get_lod` of a 2D array, validates it and makes a pipeline of it.@JRamos1993 on GitHub · 2026-11-25 06:10 UTC · original
Closing as a duplicate of #260, which I missed when I checked for existing work (I searched issues, not pull requests). Sorry for the noise.
Measured on the retail pack against
main310c6eb(RTX 5090, local DXIL hash on each validated line):mainvalidates the same 3 programs this PR does: 25,382 → 25,385. It loses none.The synthetic test here (
image_get_lodof a 2D array: emits, validates, makes a pipeline, and fails without the fix with the same validator error) is incrates/victory-shader/src/emit/image_lod_tests.rsonJRamos1993:lod-array-coords, if #260 wants one.Pull request closed