Shaders: pass only spatial coordinates to DXIL calculateLOD #103

Open
VastyViz wants to merge 1 commit from upstream-pr/103 into main
VastyViz commented 2026-11-25 12:07:10 +00:00 (Migrated from github.com)
First-time contributor

Imported from Zettrox/ztrx. Originally posted by VastyViz on 2026-11-25T11:32:54Z.


image_get_lod on array textures (1D_ARRAY and 2D_ARRAY) filled cs up to coords, passing the array slice into DXIL calculateLOD.f32. DXIL requires unused coordinate slots beyond the texture's spatial dimensions to be undef, causing the validator to reject affected pixel shaders with 'out of bound coord must be undef.'

Only load and pass the spatial coordinates when lowering op 81 (calculateLOD), leaving remaining slots undef. Add a synthetic pixel shader regression test covering 1D, 2D, 3D, 1D_ARRAY, and 2D_ARRAY validated with dxil.dll and compiled on D3D12 hardware and WARP.

<!-- greyfinch-sync:Zettrox/ztrx:issue:6603531786 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/103). Originally posted by [VastyViz](https://github.com/VastyViz) on 2026-11-25T11:32:54Z. --- image_get_lod on array textures (1D_ARRAY and 2D_ARRAY) filled cs up to coords, passing the array slice into DXIL calculateLOD.f32. DXIL requires unused coordinate slots beyond the texture's spatial dimensions to be undef, causing the validator to reject affected pixel shaders with 'out of bound coord must be undef.' Only load and pass the spatial coordinates when lowering op 81 (calculateLOD), leaving remaining slots undef. Add a synthetic pixel shader regression test covering 1D, 2D, 3D, 1D_ARRAY, and 2D_ARRAY validated with dxil.dll and compiled on D3D12 hardware and WARP.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/103:upstream-pr/103'
git switch 'upstream-pr/103'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/103'
git switch 'upstream-pr/103'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/103'
git switch 'upstream-pr/103'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/103'
git switch 'main'
git merge --squash 'upstream-pr/103'
git switch 'main'
git merge --ff-only 'upstream-pr/103'
git switch 'main'
git merge 'upstream-pr/103'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Zettrox/ztrx!103
No description provided.