Shaders: fix LOD queries on array textures #87

Closed
github-bot wants to merge 1 commit from github-bot/gh-87 into main AGit
Owner

@⁠MichaelSmithAI on GitHub · 2026-11-26 02:48 UTC · original
MichaelSmithAI:fix/array-image-get-lod → main · +102 −3 · 2 files · 1 commits · closed without merging

Fixes #74. Thanks to @⁠j-fuxa for identifying the bad operand.

For image_get_lod, lower only the spatial coordinates. Microsoft DXIL's calculateLOD takes one coordinate for Texture1DArray and two for Texture2DArray. The unused operands must be undef. Ordinary samples still lower the array slice.

The regressions use synthetic pixel programs that export both clamped and unclamped LOD. Before the change, Microsoft’s DXIL validator rejected both the 1D and 2D array programs with “out of bound coord must be undef.” Both pass after the change. The existing cube mip-selection readback also passed on an RTX 4090 under Wine. The Linux shader suite had 202 passes and two ignored tests. The repository policy check and Windows-target shader Clippy with warnings denied passed. The full Win64 shader suite under Wine reported 279 passes, four ignored tests, and one failure in stub_pipeline_is_created. Unmodified main e2a28ec reproduced the same acceptance of a zeroed shader digest under Wine.

The validation covers synthetic shaders. No title rendering change was measured. Codex assisted with implementation and testing.

**@⁠MichaelSmithAI** on GitHub · 2026-11-26 02:48 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/87) `MichaelSmithAI:fix/array-image-get-lod` → `main` · +102 −3 · 2 files · 1 commits · closed without merging Fixes #74. Thanks to @⁠j-fuxa for identifying the bad operand. For `image_get_lod`, lower only the spatial coordinates. Microsoft DXIL's `calculateLOD` takes one coordinate for Texture1DArray and two for Texture2DArray. The unused operands must be `undef`. Ordinary samples still lower the array slice. The regressions use synthetic pixel programs that export both clamped and unclamped LOD. Before the change, Microsoft’s DXIL validator rejected both the 1D and 2D array programs with “out of bound coord must be undef.” Both pass after the change. The existing cube mip-selection readback also passed on an RTX 4090 under Wine. The Linux shader suite had 202 passes and two ignored tests. The repository policy check and Windows-target shader Clippy with warnings denied passed. The full Win64 shader suite under Wine reported 279 passes, four ignored tests, and one failure in `stub_pipeline_is_created`. Unmodified main `e2a28ec` reproduced the same acceptance of a zeroed shader digest under Wine. The validation covers synthetic shaders. No title rendering change was measured. Codex assisted with implementation and testing.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:31:55 +00:00
Author
Owner

@⁠iLucasRT on GitHub · 2026-11-26 03:59 UTC · original

Tested on an RX 7900 XTX 24 GB, Ryzen 7 5800X3D, 64 GB RAM, Windows 11.

Same machine; 25 minutes played with it. No new visual problems were reported and no new warnings
appeared in the log, compared with the previous session. We could not tell whether the fixed
shaders ran in that stretch, so this only says that nothing regressed.

**@⁠iLucasRT** on GitHub · 2026-11-26 03:59 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/87#issuecomment-7182194279) Tested on an RX 7900 XTX 24 GB, Ryzen 7 5800X3D, 64 GB RAM, Windows 11. Same machine; 25 minutes played with it. No new visual problems were reported and no new warnings appeared in the log, compared with the previous session. We could not tell whether the fixed shaders ran in that stretch, so this only says that nothing regressed.
github-bot 2026-11-26 07:36:21 +00:00
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:31 UTC · original

Already fixed on main by 41d3184e (a level query takes no array slice); closing.

**@⁠avatarmanz** on GitHub · 2026-11-26 07:31 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/87#issuecomment-7185555276) Already fixed on main by 41d3184e (a level query takes no array slice); closing.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.