shader: a non-cube view's unused size-query extent reads 0 #651

Open
AnastasisKon wants to merge 331 commits from upstream-pr/651 into main
AnastasisKon commented 2026-11-29 08:49:13 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-29T08:49:13Z.


Ported from coolfox-dg 0e525f12f (Dathinel) via halfwave50/VIctory-macOS-halfwave50 4ac1eac6.

What changed

  • image_get_resinfo (op 72) left a channel that DXIL's getDimensions omits as 1, so a 2D view's depth read 1. Non-cube views now give 0 for an unused extent; a cube's depth stays 1 and a UAV still reports one level. This line's writable-image level behaviour is kept (the source tree lacks it).
  • build() in waterfall_tests.rs takes the expected nonuniform-handle count: 1 at every existing call, 0 for the new uniform-descriptor program image_resinfo_returns_zero_depth_for_a_2d_view (asserts [3, 2, 0, 1] per lane; Windows/Wine test path, as on the source line).

Testing

  • cargo test -p victory-hle -p victory -p victory-shader -p victory-gpu -p xtask -- --test-threads=1 — 1121 passed, 0 failed (the waterfall test runs in the Windows/Wine path; this Mac cannot run it)
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings
  • cargo xtask policy (478 files ok)

Checklist

  • One change per PR, plus one drive-by: hle: name why dereferencing the device out pointer is sound — an undocumented unsafe block in d3d12x.rs failed the required gnullvm clippy run on main for everyone; a safety comment is the whole fix.
  • Nothing from the game in the commit
  • No worktree left behind

Source attribution: RDNA2 dimension correction by EatCodeSleep2 and Moon0755 (Marvisak/VIctory#1313, fxceless/victory-fork#957), carried by coolfox-dg 0e525f12f and halfwave50 4ac1eac6.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:issue:5549149911 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/651). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-29T08:49:13Z. --- Ported from coolfox-dg 0e525f12f (Dathinel) via halfwave50/VIctory-macOS-halfwave50 4ac1eac6. **What changed** - `image_get_resinfo` (op 72) left a channel that DXIL's `getDimensions` omits as 1, so a 2D view's depth read 1. Non-cube views now give 0 for an unused extent; a cube's depth stays 1 and a UAV still reports one level. This line's writable-image level behaviour is kept (the source tree lacks it). - `build()` in `waterfall_tests.rs` takes the expected nonuniform-handle count: 1 at every existing call, 0 for the new uniform-descriptor program `image_resinfo_returns_zero_depth_for_a_2d_view` (asserts `[3, 2, 0, 1]` per lane; Windows/Wine test path, as on the source line). **Testing** - [x] `cargo test -p victory-hle -p victory -p victory-shader -p victory-gpu -p xtask -- --test-threads=1` — 1121 passed, 0 failed (the waterfall test runs in the Windows/Wine path; this Mac cannot run it) - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` - [x] `cargo xtask policy` (478 files ok) **Checklist** - [x] One change per PR, plus one drive-by: `hle: name why dereferencing the device out pointer is sound` — an undocumented unsafe block in `d3d12x.rs` failed the required gnullvm clippy run on main for everyone; a safety comment is the whole fix. - [x] Nothing from the game in the commit - [x] No worktree left behind Source attribution: RDNA2 dimension correction by EatCodeSleep2 and Moon0755 (Marvisak/VIctory#1313, fxceless/victory-fork#957), carried by coolfox-dg 0e525f12f and halfwave50 4ac1eac6.
AnastasisKon commented 2026-11-29 09:02:32 +00:00 (Migrated from github.com)

Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-29T09:02:32Z.


Added, same integration: formats: map console texture formats 189-191 (Pragyaan Gaur's mac 197796cd via halfwave50 PR #19) and hle: a save version that cannot be removed does not fail the container (Pragyaan Gaur's mac 5f7409be via halfwave50 PR #19). Both carry their tests; the full suite (1122 passed) and clippy/policy are green.

<!-- greyfinch-sync:LakshanSivakumar/Native-Victory-macOS:comment:7253496451 --> Imported from [LakshanSivakumar/Native-Victory-macOS](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/651#issuecomment-7253496451). Originally posted by [AnastasisKon](https://github.com/AnastasisKon) on 2026-11-29T09:02:32Z. --- Added, same integration: `formats: map console texture formats 189-191` (Pragyaan Gaur's mac 197796cd via halfwave50 PR #19) and `hle: a save version that cannot be removed does not fail the container` (Pragyaan Gaur's mac 5f7409be via halfwave50 PR #19). Both carry their tests; the full suite (1122 passed) and clippy/policy are green.
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/651:upstream-pr/651'
git switch 'upstream-pr/651'

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/651'
git switch 'upstream-pr/651'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/651'
git switch 'upstream-pr/651'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/651'
git switch 'main'
git merge --squash 'upstream-pr/651'
git switch 'main'
git merge --ff-only 'upstream-pr/651'
git switch 'main'
git merge 'upstream-pr/651'
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
LakshanSivakumar/Native-Victory-macOS!651
No description provided.