Shaders: lower image_get_lod on cube textures #1004

Open
tarcisioads wants to merge 1 commit from upstream-pr/1004 into main
tarcisioads commented 2026-11-24 14:53:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by tarcisioads on 2026-11-24T14:53:44Z.


Support image_get_lod (dx.op.calculateLOD.f32, opcode 81) on cube textures (dim = 3) in crates/victory-shader/src/emit/lower.rs:

  • Allow image_get_lod in pixel shaders for dim = 3 (kind = 5, coords = 3).
  • Remove op == 81 from the kind == 5 refusal (keeping *unorm || op == 63), so cube_direction converts the face coordinates into a 3D direction vector before calculateLOD.f32.
  • Add unit test cube_image_get_lod_lowers.

Verification

  • cargo test -p victory-shader (97 passed, 0 failed, 1 ignored benchmark on macOS; Windows dxil.dll validation not run)
  • cargo xtask policy (ok)
<!-- greyfinch-sync:Marvisak/VIctory:issue:5474534859 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1004). Originally posted by [tarcisioads](https://github.com/tarcisioads) on 2026-11-24T14:53:44Z. --- Support `image_get_lod` (`dx.op.calculateLOD.f32`, opcode `81`) on cube textures (`dim = 3`) in `crates/victory-shader/src/emit/lower.rs`: - Allow `image_get_lod` in pixel shaders for `dim = 3` (`kind = 5`, `coords = 3`). - Remove `op == 81` from the `kind == 5` refusal (keeping `*unorm || op == 63`), so `cube_direction` converts the face coordinates into a 3D direction vector before `calculateLOD.f32`. - Add unit test `cube_image_get_lod_lowers`. ### Verification - `cargo test -p victory-shader` (97 passed, 0 failed, 1 ignored benchmark on macOS; Windows `dxil.dll` validation not run) - `cargo xtask policy` (ok)
andrewpozdnakov7-jpg commented 2026-11-24 16:05:00 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-24T15:06:26Z.


Windows validation on cbc8c33. I extended the existing cube LOD fixture to pass its emitted DXIL through Microsoft’s validator, then created a pixel PSO with the fixture shader and the test vertex stub. Both checks passed, and validation kept the emitted container hash.

The full shader suite with native WARP 1.0.22 and Agility 1.620.2 reported 121 passed and 1 ignored. The inbox runtime on this host lacks SM 6.6, which accounts for the GPU test failures when run with the default loader.

This check covers DXIL acceptance and PSO creation. AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135468990 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1004#issuecomment-7135468990). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-24T15:06:26Z. --- Windows validation on `cbc8c33`. I extended the existing cube LOD fixture to pass its emitted DXIL through Microsoft’s validator, then created a pixel PSO with the fixture shader and the test vertex stub. Both checks passed, and validation kept the emitted container hash. The full shader suite with native WARP 1.0.22 and Agility 1.620.2 reported 121 passed and 1 ignored. The inbox runtime on this host lacks SM 6.6, which accounts for the GPU test failures when run with the default loader. This check covers DXIL acceptance and PSO creation. AI-assisted.
Zipettte commented 2026-11-24 16:05:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T15:12:53Z.


Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at cbc8c33: cargo test -p victory-shader passes, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135646905 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1004#issuecomment-7135646905). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T15:12:53Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at cbc8c33: `cargo test -p victory-shader` passes, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
MamaLeVrai commented 2026-11-24 18:05:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by MamaLeVrai on 2026-11-24T17:23:53Z.


Heads-up: this PR and #563 both edit the cube-sample refusal in emit/lower.rs and conflict with each other. Merged together only texel coordinates are still refused; that resolution is in the bundle #1319 (clippy and tests pass). AI-assisted (Claude Code); no game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139132830 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1004#issuecomment-7139132830). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-24T17:23:53Z. --- Heads-up: this PR and #563 both edit the cube-sample refusal in `emit/lower.rs` and conflict with each other. Merged together only texel coordinates are still refused; that resolution is in the bundle #1319 (clippy and tests pass). AI-assisted (Claude Code); no game data.
Marvisak commented 2026-11-25 02:06:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:25:46Z.


Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main: main has moved since the last triage, and the branch now conflicts in crates/victory-shader/src/emit/lower.rs. It will be reviewed again once it is rebased onto current main.

Previous verdict for this head: merge candidate.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149536333 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1004#issuecomment-7149536333). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:25:46Z. --- <!-- victory-triage v1 head=eb3e2297eda252fa7f9a994f7d1c354e55c5b0cb verdict=needs-rebase at=2026-11-25T22:32:00Z --> Automated triage for the maintainers. **Needs rebase.** This PR no longer merges cleanly into `main`: `main` has moved since the last triage, and the branch now conflicts in `crates/victory-shader/src/emit/lower.rs`. It will be reviewed again once it is rebased onto current `main`. Previous verdict for this head: merge candidate. --- _Generated by [Claude Code](https://claude.ai/code)_
catminou4 commented 2026-11-25 03:56:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:56:33Z.

Review: CHANGES_REQUESTED


Merge with current main (940d32f69b) breaks compilation — verified locally after git merge origin/main:

error[E0063]: missing field `view_marks` in initializer of `Parts<'_>`

Main added view_marks to Parts after this PR was opened (same break as #1587/#1519 — a rebase initializing the new field should fix it). image_get_lod on cube textures looks right; I will re-test after the rebase.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051643623 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1004#pullrequestreview-6051643623). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T03:56:33Z. **Review:** CHANGES_REQUESTED --- Merge with current main (940d32f69b) breaks compilation — verified locally after `git merge origin/main`: ``` error[E0063]: missing field `view_marks` in initializer of `Parts<'_>` ``` Main added `view_marks` to `Parts` after this PR was opened (same break as #1587/#1519 — a rebase initializing the new field should fix it). image_get_lod on cube textures looks right; I will re-test after the rebase.
DenRakEiw commented 2026-11-25 11:54:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T11:54:20Z.

Review: APPROVED


Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:

  • Clean lowering of image_get_lod on cube textures with dxil.dll validation.
  • cargo test -p victory-shader emit::lower::tests: 22/22 passed on RTX 5090, 22/22 passed on WARP (including cube_image_get_lod_lowers).
  • cargo clippy -p victory-shader --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6057120884 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1004#pullrequestreview-6057120884). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T11:54:20Z. **Review:** APPROVED --- Verified against `origin/main` (`940d32f`) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP: - Clean lowering of `image_get_lod` on cube textures with `dxil.dll` validation. - `cargo test -p victory-shader emit::lower::tests`: 22/22 passed on RTX 5090, 22/22 passed on WARP (including `cube_image_get_lod_lowers`). - `cargo clippy -p victory-shader --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 183 files ok. AI-assisted (Gemini 4 Neon).
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/1004:upstream-pr/1004'
git switch 'upstream-pr/1004'

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/1004'
git switch 'upstream-pr/1004'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1004'
git switch 'upstream-pr/1004'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1004'
git switch 'main'
git merge --squash 'upstream-pr/1004'
git switch 'main'
git merge --ff-only 'upstream-pr/1004'
git switch 'main'
git merge 'upstream-pr/1004'
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
Marvisak/VIctory!1004
No description provided.