Shaders: fix LOD queries on array textures #87

Closed
MichaelSmithAI wants to merge 1 commit from upstream-pr/87 into main
MichaelSmithAI commented 2026-11-26 02:48:29 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by MichaelSmithAI on 2026-11-26T02:48:29Z.


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.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6618408668 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/87). Originally posted by [MichaelSmithAI](https://github.com/MichaelSmithAI) on 2026-11-26T02:48:29Z. --- 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.
iLucasRT commented 2026-11-26 03:59:13 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by iLucasRT on 2026-11-26T03:59:13Z.


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.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7182194279 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/87#issuecomment-7182194279). Originally posted by [iLucasRT](https://github.com/iLucasRT) on 2026-11-26T03:59:13Z. --- 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.
avatarmanz commented 2026-11-26 07:31:47 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by avatarmanz on 2026-11-26T07:31:47Z.


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

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7185555276 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/87#issuecomment-7185555276). Originally posted by [avatarmanz](https://github.com/avatarmanz) on 2026-11-26T07:31:47Z. --- Already fixed on main by 41d3184e (a level query takes no array slice); closing.

Pull request closed

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
avatarmanz/VIctory-7900XTX!87
No description provided.