Shaders: CalculateLOD gets only the spatial coordinates #260

Open
Ortomanic wants to merge 2 commits from upstream-pr/260 into main
Ortomanic commented 2026-11-24 23:02:04 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Ortomanic on 2026-11-24T23:02:04Z.


Changes

CalculateLOD was passed every coordinate component of the sample it was derived from. The DXIL validator wants the components beyond the texture's spatial dimensions to be undef (out of bound coord must be undef). The level-of-detail query now passes only the spatial coordinates.

Validation

  • Offline over the title's shader pack: the three programs that failed dxv with that message pass (34e55a0e, cc182397, d52fbc59). Only those three programs' DXIL changes; none is lost and there are no new dxv or dxil-spirv failures.
  • None of the three is bound in the part of the title I can reach, so there is no in-game result for this change.
  • cargo clippy --workspace --all-targets --locked -- -D warnings for the Windows target, with and without --all-features, and cargo test -p victory-shader -p xtask pass on this branch (cross-compiled from Linux with the pinned toolchain).

AI-assisted patch with local build and offline validation.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593156414 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/260). Originally posted by [Ortomanic](https://github.com/Ortomanic) on 2026-11-24T23:02:04Z. --- ## Changes `CalculateLOD` was passed every coordinate component of the sample it was derived from. The DXIL validator wants the components beyond the texture's spatial dimensions to be `undef` (`out of bound coord must be undef`). The level-of-detail query now passes only the spatial coordinates. ## Validation - Offline over the title's shader pack: the three programs that failed dxv with that message pass (`34e55a0e`, `cc182397`, `d52fbc59`). Only those three programs' DXIL changes; none is lost and there are no new dxv or dxil-spirv failures. - None of the three is bound in the part of the title I can reach, so there is no in-game result for this change. - `cargo clippy --workspace --all-targets --locked -- -D warnings` for the Windows target, with and without `--all-features`, and `cargo test -p victory-shader -p xtask` pass on this branch (cross-compiled from Linux with the pinned toolchain). AI-assisted patch with local build and offline validation.
JRamos1993 commented 2026-11-25 07:06:14 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by JRamos1993 on 2026-11-25T06:10:12Z.


Offline check on the retail shader pack: this PR, merged onto current main 310c6eb, fixes the 3 "out of bound coord must be undef" pixel programs, loses none, and changes nothing else.

Setup: RTX 5090, Windows 11. victory translate --validate --list over the title's full shader pack, with a local DXIL hash on each validated line:

  • Validated: 25,382 → 25,385. None lost, and no other program's DXIL changes.
  • Pipelines: with the same fix, --pipelines on the 3 creates 3 pipelines, 0 refused.

Duplicate closed: I had opened #720 for the same thing without seeing this PR; it emits byte-identical DXIL for all programs, and I closed it. It has a small synthetic test (image_get_lod of a 2D array: emits, validates, makes a pipeline, and fails without the fix) on JRamos1993:lod-array-coords in crates/victory-shader/src/emit/image_lod_tests.rs, if you want one here.

AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7154513247 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/260#issuecomment-7154513247). Originally posted by [JRamos1993](https://github.com/JRamos1993) on 2026-11-25T06:10:12Z. --- **Offline check on the retail shader pack: this PR, merged onto current `main` `310c6eb`, fixes the 3 "out of bound coord must be undef" pixel programs, loses none, and changes nothing else.** **Setup:** RTX 5090, Windows 11. `victory translate --validate --list` over the title's full shader pack, with a local DXIL hash on each validated line: - **Validated:** 25,382 → **25,385**. None lost, and no other program's DXIL changes. - **Pipelines:** with the same fix, `--pipelines` on the 3 creates 3 pipelines, 0 refused. **Duplicate closed:** I had opened #720 for the same thing without seeing this PR; it emits byte-identical DXIL for all programs, and I closed it. It has a small synthetic test (`image_get_lod` of a 2D array: emits, validates, makes a pipeline, and fails without the fix) on `JRamos1993:lod-array-coords` in `crates/victory-shader/src/emit/image_lod_tests.rs`, if you want one here. AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.
iGoldenNinja commented 2026-11-25 12:07:04 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by iGoldenNinja on 2026-11-25T11:48:30Z.


Independent RTX 5080 result on NVIDIA fork f85101b6095e8cf3cecf8f0647cc7f5428daa177, Windows 11 Pro 25H2 build 26200.9974, driver 617.14 and DXIL validator 1.9.2609.5.

I adapted ZTRX PR 103's synthetic fixture to require validation and pipeline creation on both the hardware adapter and WARP. The parent failed on the 1D array case with out of bound coord must be undef. The port that leaves the slice operand undefined passed validation and made pipelines for all five dimensions in the fixture (1D, 2D, 3D, 1D array and 2D array). This adds a 1D-array check alongside the 2D-array cases reported above. The measured stage was D3D12 graphics pipeline creation. Pinned port and fixture

Testing and reporting assisted by OpenAI Codex.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7161525806 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/260#issuecomment-7161525806). Originally posted by [iGoldenNinja](https://github.com/iGoldenNinja) on 2026-11-25T11:48:30Z. --- Independent RTX 5080 result on NVIDIA fork `f85101b6095e8cf3cecf8f0647cc7f5428daa177`, Windows 11 Pro 25H2 build 26200.9974, driver 617.14 and DXIL validator 1.9.2609.5. I adapted [ZTRX PR 103's synthetic fixture](https://github.com/Zettrox/ztrx/pull/103) to require validation and pipeline creation on both the hardware adapter and WARP. The parent failed on the **1D array** case with `out of bound coord must be undef`. The port that leaves the slice operand undefined passed validation and made pipelines for all five dimensions in the fixture (1D, 2D, 3D, 1D array and 2D array). This adds a 1D-array check alongside the 2D-array cases reported above. The measured stage was D3D12 graphics pipeline creation. [Pinned port and fixture](https://github.com/iGoldenNinja/victory-fork/commit/a2d5af8bfebc824eb0f7111c2577fca038e83d7d) Testing and reporting assisted by OpenAI Codex.
Ortomanic commented 2026-11-25 16:12:50 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Ortomanic on 2026-11-25T15:11:08Z.


Thanks @JRamos1993 and @iGoldenNinja, and thanks for closing the duplicate.

  • Test added: d140e4e takes @JRamos1993's image_lod_tests.rs from lod-array-coords (970bc3d, authorship kept), without its lowering change, since this branch has an equivalent one.
  • 1D array: I made the program's image word a parameter and added a second test on a 1D array, the case @iGoldenNinja reported. I wrote that variant myself from the 2D one rather than porting the ZTRX fixture.
  • Results under Wine 11.22 with validator 1.9.2609.5, RTX 5080 through vkd3d-proton: both tests pass. With the fix taken out both fail with out of bound coord must be undef (the 2D array passes the slice as the third coordinate, the 1D array as the second). Pipeline creation ran on the hardware device; I did not confirm that the WARP half of the loop ran in this prefix.
  • Current main: merges cleanly with 0b0074e; cargo test -p victory-shader -p xtask passes on the merged tree, and clippy with -D warnings passes on the branch in both feature sets (the merged tree fails only with main's own errors, #982 and #841).

The tests are cfg(all(test, windows)), like the file they come from. The head was not rebased.

AI-assisted (Claude Code); built and tested locally.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7166438007 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/260#issuecomment-7166438007). Originally posted by [Ortomanic](https://github.com/Ortomanic) on 2026-11-25T15:11:08Z. --- Thanks @JRamos1993 and @iGoldenNinja, and thanks for closing the duplicate. - **Test added:** `d140e4e` takes @JRamos1993's `image_lod_tests.rs` from `lod-array-coords` (`970bc3d`, authorship kept), without its lowering change, since this branch has an equivalent one. - **1D array:** I made the program's image word a parameter and added a second test on a 1D array, the case @iGoldenNinja reported. I wrote that variant myself from the 2D one rather than porting the ZTRX fixture. - **Results under Wine 11.22 with validator 1.9.2609.5, RTX 5080 through vkd3d-proton:** both tests pass. With the fix taken out both fail with `out of bound coord must be undef` (the 2D array passes the slice as the third coordinate, the 1D array as the second). Pipeline creation ran on the hardware device; I did not confirm that the WARP half of the loop ran in this prefix. - **Current main:** merges cleanly with `0b0074e`; `cargo test -p victory-shader -p xtask` passes on the merged tree, and clippy with `-D warnings` passes on the branch in both feature sets (the merged tree fails only with main's own errors, #982 and #841). The tests are `cfg(all(test, windows))`, like the file they come from. The head was not rebased. AI-assisted (Claude Code); built and tested locally.
HAL9000RELOADED commented 2026-11-25 20:09:28 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by HAL9000RELOADED on 2026-11-25T19:30:00Z.


RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main d510ee4: both new tests pass on the card with this PR. No other test changed. Run table: #129 (https://github.com/fxceless/victory-fork/pull/129#issuecomment-7172358511).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7172381794 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/260#issuecomment-7172381794). Originally posted by [HAL9000RELOADED](https://github.com/HAL9000RELOADED) on 2026-11-25T19:30:00Z. --- RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main `d510ee4`: both new tests pass on the card with this PR. No other test changed. Run table: #129 (https://github.com/fxceless/victory-fork/pull/129#issuecomment-7172358511).
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/260:upstream-pr/260'
git switch 'upstream-pr/260'

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/260'
git switch 'upstream-pr/260'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/260'
git switch 'upstream-pr/260'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/260'
git switch 'main'
git merge --squash 'upstream-pr/260'
git switch 'main'
git merge --ff-only 'upstream-pr/260'
git switch 'main'
git merge 'upstream-pr/260'
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
fxceless/victory-fork!260
No description provided.