Shaders: the level of detail of an array texture takes no slice (3 programs) #720
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/720"
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?
Imported from fxceless/victory-fork. Originally posted by JRamos1993 on 2026-11-25T05:38:14Z.
Part 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.
Imported from fxceless/victory-fork. Originally posted by JRamos1993 on 2026-11-25T06:10:09Z.
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