image_get_lod on array textures passes the slice as a LOD coordinate #74
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 avatarmanz/VIctory-7900XTX. Originally posted by j-fuxa on 2026-11-26T01:40:57Z.
Where.
crates/victory-shader/src/emit/lower.rs, image sample lowering, theop == 81arm (image_get_lod). It callscalculateLODwith[h, sh, cs[0], cs[1], cs[2], clamped], wherecsholds every address coordinate. Fordim4 and 5 (1-D and 2-D arrays,kind6 and 7) the last coordinate is the array slice, so it lands in a coordinate slot of the LOD query. DXIL's LOD query has no slice, and the validator requires unused coordinates to be undef ("out of bound coord must be undef").Evidence. In our tree (same lineage) three pixel programs, G-buffer alpha-clip passes, failed validation for exactly this reason. Passing undef for the slice slot (
cs[2]for a 2-D array,cs[1]for a 1-D array) made all three translate. We did not run your tree: this is from reading0a435665, and something earlier in the path may already replace the slot; we did not see it.Why it matters. A pixel program that does not translate has its draws dropped (
pipeline.rs: "shader does not translate; its pipelines' draws are dropped"), so alpha-clipped surfaces using it would be missing, with that warning as the only trace.Suggested fix. Build the coordinate list of op 81 from the
spatialcoordinates only and give every slot fromspatialon the undef valuefu. A validator test next tocube_lod_tests.rswith a 2-D arrayimage_get_lodwould pin it.Not checked for your tree, for comparison only. Two other families refused in ours; your
victory shadersreason list would show them if they refuse here. (1) Deferred pixel programs with unrolled light-list loops, refused as "a lane mask read as data": proving the joined mask unread through later joins translated 254 programs with no wave op emitted. (2) Vehicle-livery pixel programs where a guarded write in a waterfall loop keeps a deadv_interp_p1ll_f16result in the register ("the first half of an interpolation"): giving that half its hardware valueP0 + i*(P1-P0)throughSV_Barycentricstranslated all 20. Yourwith_first_half_pairsretry may already cover (2).Imported from avatarmanz/VIctory-7900XTX. Originally posted by BE29ZZ on 2026-11-26T01:46:15Z.
Are you still struggling with this error? Would you like me to help?
Imported from avatarmanz/VIctory-7900XTX. Originally posted by avatarmanz on 2026-11-26T07:31:51Z.
Fixed on main by
41d3184e: image_get_lod no longer passes the array slice as a coordinate.