Shaders: validate LOD queries across five texture shapes #235
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/Belobug--VIctory-Belobug-AMD!235
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-235"
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?
@loyodea on GitHub · 2026-11-26 08:01 UTC · original
loyodea:victory-rx9070xt-array-lod→a-publier· +76 −1 · 1 files · 1 commits · openRelated to the array-slice report in #218. The current default branch already omits array slice coordinates from LOD queries via
41d3184. This PR keeps the original synthetic regression.The fixture validates both LOD outputs for 1D, 2D, and 3D textures and for 1D and 2D arrays. Both the existing array test and the five-shape test passed using the Microsoft DXIL validator on a-publier at
4eb6cfdf.The code diff is unchanged from the previous revision. This PR now targets a-publier, where #328 and #330 fixed the WARP depth-bounds fixture and Clippy errors that failed CI on rx9070xt. The fixture uses generated shader instructions. Codex contributed the test and verification.
@gut0to on GitHub · 2026-11-26 16:19 UTC · original · reviewed
AI-assisted review. I inspected the LOD coordinate lowering and the added validator fixture statically; I did not run tests. This review suggests one additional texture-shape case.
@ -11101,1 +11101,4 @@let f32t = self.s.t.f32;// DXIL takes only the spatial coordinates. Leave the array slice undef.let mut lod_coords = [fu; 3];lod_coords[..spatial].copy_from_slice(&cs[..spatial]);@gut0to on GitHub · 2026-11-26 16:19 UTC · original
AI-assisted review; I did not run tests. Could the validator fixture include a cube-array query as well? The current matrix covers 1D/2D arrays and 3D textures, but a cube-array carries a fourth array-slice coordinate alongside its three spatial direction coordinates. That case would directly verify that the slice stays undefined while all three spatial coordinates are preserved.
@ -11101,1 +11101,4 @@let f32t = self.s.t.f32;// DXIL takes only the spatial coordinates. Leave the array slice undef.let mut lod_coords = [fu; 3];lod_coords[..spatial].copy_from_slice(&cs[..spatial]);@loyodea on GitHub · 2026-11-26 18:53 UTC · original
Thanks for checking the texture shapes. GFX10 uses one cube selector and packs the cube-array slice into the face operand. This branch currently rejects cube LOD queries. DXIL
calculateLODtakes three direction coordinates for both cubes and cube arrays, so a cube-array fixture here would first need cube LOD lowering. The current fixture covers the five supported shapes. AMD RDNA 2 ISA, table 43 · DXIL CalculateLOD@adrianmjim on GitHub · 2026-11-26 22:42 UTC · original
Checked by reading the code on rx9070xt
cd8dfc0(head1e500d2); I did not build or run this PR.cd8dfc0already has the same fix in41d3184("Shaders: a level query takes no array slice"). For op 81 only the spatial coordinates are read (crates/victory-shader/src/emit/lower.rs:11776-11782).csstarts undef (lower.rs:11763) and the call passescs[0..3](lower.rs:11815). Thelod_coordscopy here would be a no-op on that base.lower.rs:11422,lower.rs:11750).cd8dfc0only tests the 2D array:a_level_query_of_an_array_takes_no_slice(emit/mod.rs:1209). Your five-shape fixture adds coverage for 1D, 2D, 3D and 1D array. It could stay as a test-only change rebased oncd8dfc0.texture_tables,PartsandS_ENDPGMare all there.81ebb7b. Merging it intocd8dfc0conflicts incrates/victory-gpu/src/ambient.rs,host.rsandpipeline/make.rs. Commit1e500d2on its own applies to cd8dfc0'slower.rswithout conflict.4eb6cfd. None of those commits touchlower.rsoremit/mod.rs, so the above holds there too.translate --validateofcd8dfc0: 0 "out of bound coord" validator errors, and 14247 of 14247 vertex and pixel programs validated. That includes the three pixel programs named in41d3184.Not checked: building or running the fixture on
cd8dfc0.Shaders: leave array slices undefined in LOD queriesto Shaders: validate LOD queries across five texture shapes1e500d25d8tofcfd790c32View 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.