GPU: check every unordered texture view against the host's typed-store support (#1754) #1779

Open
LarryBebou wants to merge 1 commit from upstream-pr/1780 into main
LarryBebou commented 2026-11-24 22:25:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LarryBebou on 2026-11-24T22:25:50Z.


Fixes the DXGI_ERROR_INVALID_CALL (0x887A0001) removal before the menus on NVIDIA reported in #1754.

Why

descriptor::host::fits refuses an unordered view the host cannot store to, but only when the view is cast to another format family (cast && family(view) != family(own)). A texture viewed in its own format is never checked. The title has a 2560x1440 B5G5R5A1_UNORM texture with unordered access; NVIDIA has no D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW for that format, so creating the view is an invalid call. With the debug layer, CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM) cannot be used with a Typed Unordered Access View (id 342) is followed 1 ms later by the removal (id 232). Details and the time order in #1754.

What

  • Every unordered texture view is checked against typed_store in the format it is made in: the view's on a typeless or castable texture, the texture's otherwise (viewed_format, pure).
  • A view that fails stays null, as the cast case already did; the existing once! warning names it.
  • Unit test unordered_views_are_checked_in_the_format_they_are_made_in.

shortcut, also in the code: the title's writes to such a texture are lost. Packed 16-bit formats need their own unordered path (a R16_UINT alias or similar) to keep them.

Tested

RTX 5060 8 GB, driver 32.0.16.2124, Windows 11 26300; title 1.0.2.1, Series X profile; diag build, VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1, shader cache warmed with translate --cache.

70564ae 70564ae + this PR
id 342 / INVALID_CALL removal yes, before the menus no
Menus and loading screen stop at frame 128 30 fps, frame 2048 captured and correct
an unordered view in a format the host cannot store — logged once

The run then stops on two known NVIDIA problems this PR does not touch: no dynamic slots for its tables on the capped view heap (#747, #1349) and, later, DXGI_ERROR_DEVICE_HUNG in the world (#71).

Checks:

  • cargo clippy --workspace --all-targets --locked -- -D warnings: passed
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passed
  • cargo xtask policy: passed (174 files)
  • cargo test --workspace --locked: 472 passed, 5 failed. The 5 fail the same way on 70564ae without this change on this machine: victory-gpu dynamic_slots_are_held_until_released and lists_share_a_table_and_copies_keep_their_views (checked on an untouched checkout), and victory-shader a_heap_buffer_read_by_element_takes_the_views_stride, a_heap_buffer_read_where_no_buffer_view_is_reads_zeros and gathers_at_a_level_match_the_hardware (a crate this PR does not change).

Not run on AMD or Intel; on a host that supports typed UAVs of B5G5R5A1_UNORM nothing changes, since typed_store returns true there.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6592639813 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1780). Originally posted by [LarryBebou](https://github.com/LarryBebou) on 2026-11-24T22:25:50Z. --- Fixes the `DXGI_ERROR_INVALID_CALL` (0x887A0001) removal before the menus on NVIDIA reported in #1754. ## Why `descriptor::host::fits` refuses an unordered view the host cannot store to, but only when the view is cast to another format family (`cast && family(view) != family(own)`). A texture viewed in its own format is never checked. The title has a 2560x1440 `B5G5R5A1_UNORM` texture with unordered access; NVIDIA has no `D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW` for that format, so creating the view is an invalid call. With the debug layer, `CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM) cannot be used with a Typed Unordered Access View` (id 342) is followed 1 ms later by the removal (id 232). Details and the time order in [#1754](https://github.com/Marvisak/VIctory/issues/1754#issuecomment-7146120917). ## What - Every unordered texture view is checked against `typed_store` in the format it is made in: the view's on a typeless or castable texture, the texture's otherwise (`viewed_format`, pure). - A view that fails stays null, as the cast case already did; the existing `once!` warning names it. - Unit test `unordered_views_are_checked_in_the_format_they_are_made_in`. shortcut, also in the code: the title's writes to such a texture are lost. Packed 16-bit formats need their own unordered path (a `R16_UINT` alias or similar) to keep them. ## Tested RTX 5060 8 GB, driver 32.0.16.2124, Windows 11 26300; title 1.0.2.1, Series X profile; diag build, `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`, shader cache warmed with `translate --cache`. | | `70564ae` | `70564ae` + this PR | |---|---|---| | id 342 / `INVALID_CALL` removal | yes, before the menus | no | | Menus and loading screen | stop at frame 128 | 30 fps, frame 2048 captured and correct | | `an unordered view in a format the host cannot store` | — | logged once | The run then stops on two known NVIDIA problems this PR does not touch: `no dynamic slots for its tables` on the capped view heap (#747, #1349) and, later, `DXGI_ERROR_DEVICE_HUNG` in the world (#71). Checks: - `cargo clippy --workspace --all-targets --locked -- -D warnings`: passed - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`: passed - `cargo xtask policy`: passed (174 files) - `cargo test --workspace --locked`: 472 passed, 5 failed. The 5 fail the same way on `70564ae` without this change on this machine: `victory-gpu` `dynamic_slots_are_held_until_released` and `lists_share_a_table_and_copies_keep_their_views` (checked on an untouched checkout), and `victory-shader` `a_heap_buffer_read_by_element_takes_the_views_stride`, `a_heap_buffer_read_where_no_buffer_view_is_reads_zeros` and `gathers_at_a_level_match_the_hardware` (a crate this PR does not change). Not run on AMD or Intel; on a host that supports typed UAVs of `B5G5R5A1_UNORM` nothing changes, since `typed_store` returns true there.
catminou4 commented 2026-11-24 23:05:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:03:21Z.

Review: COMMENTED


Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

Every unordered texture view checked against the host's typed-store capability: 2.8K, narrow validation addition complementing #1775/#1787/#1801.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048800884 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1780#pullrequestreview-6048800884). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T23:03:21Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. Every unordered texture view checked against the host's typed-store capability: 2.8K, narrow validation addition complementing #1775/#1787/#1801.
DesertGamer commented 2026-11-24 23:05:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-24T22:34:27Z.


VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146392531 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1780#issuecomment-7146392531). Originally posted by [DesertGamer](https://github.com/DesertGamer) on 2026-11-24T22:34:27Z. --- ### VIctory V2: community PRs, merged and tested Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch. **Where it stands today:** launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1). :warning: Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk. Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help: https://DesertGamer/VIctory-V2 *Unofficial community fork of Marvisak/VIctory, GPL-3.0.*
Vedoxdev123 commented 2026-11-24 23:06:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Vedoxdev123 on 2026-11-24T22:56:15Z.


Tested on Windows with AMD Ryzen 5 5600X + NVIDIA GeForce RTX 4060:

cargo test -p victory-gpu --lib -> 77 passed; 2 failed; 1 ignored (up from 76 passed on main; the new test passes, and the 2 failures are the known 1,000,000 view heap cap tests tracked in #1744).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7146819941 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1780#issuecomment-7146819941). Originally posted by [Vedoxdev123](https://github.com/Vedoxdev123) on 2026-11-24T22:56:15Z. --- Tested on Windows with AMD Ryzen 5 5600X + NVIDIA GeForce RTX 4060: `cargo test -p victory-gpu --lib` -> **77 passed; 2 failed; 1 ignored** (up from 76 passed on `main`; the new test passes, and the 2 failures are the known 1,000,000 view heap cap tests tracked in #1744).
Marvisak commented 2026-11-25 07:03:08 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:18:07Z.


Automated triage for the maintainers.

Proposed close: duplicate of #1763. viewed_format and the widened typed_store check in fits (crates/victory-gpu/src/descriptor/host.rs) check every unordered view in the format it is made in. That fixes the B5G5R5A1_UNORM device removal in #1753/#1754. #1763 makes the same change to the same function (its target is your viewed_format). It merges cleanly, was triaged first, and also covers the view == 0 arm, which this PR leaves returning !typeless without a store check.

If this PR covers a case #1763 misses, say which one and this verdict can be revisited.

CI: no check runs on the head commit.

This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the triage: proposed close label.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7154649835 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1780#issuecomment-7154649835). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T06:18:07Z. --- <!-- victory-triage v1 head=151fa7d7316d9bd008e7c435223388a18a66dd06 verdict=proposed-close at=2026-11-25T06:37:00Z --> Automated triage for the maintainers. **Proposed close: duplicate of #1763.** `viewed_format` and the widened `typed_store` check in `fits` (`crates/victory-gpu/src/descriptor/host.rs`) check every unordered view in the format it is made in. That fixes the `B5G5R5A1_UNORM` device removal in #1753/#1754. #1763 makes the same change to the same function (its `target` is your `viewed_format`). It merges cleanly, was triaged first, and also covers the `view == 0` arm, which this PR leaves returning `!typeless` without a store check. If this PR covers a case #1763 misses, say which one and this verdict can be revisited. CI: no check runs on the head commit. This pull request will be closed in 48 hours unless the author pushes a change or a maintainer removes the `triage: proposed close` label. --- _Generated by [Claude Code](https://claude.ai/code)_
KainanP commented 2026-11-25 20:06:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by KainanP on 2026-11-25T19:36:06Z.


RTX 4060 Laptop (610.47), merged onto main 13f91cae: the B5G5R5A1 UAV half crashes the process (access violation 0xc0000005) on a UAV without a description, because view == 0 returns before the new check; the B4G4R4A4 half still removes the device; no new failures otherwise. Details and the side-by-side table with the other #1753 PRs: https://github.com/Marvisak/VIctory/issues/1753#issuecomment-7172510623. Tested with the help of an AI assistant (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7172521293 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1780#issuecomment-7172521293). Originally posted by [KainanP](https://github.com/KainanP) on 2026-11-25T19:36:06Z. --- RTX 4060 Laptop (610.47), merged onto main 13f91cae: the B5G5R5A1 UAV half **crashes the process** (access violation 0xc0000005) on a UAV without a description, because `view == 0` returns before the new check; the B4G4R4A4 half still removes the device; no new failures otherwise. Details and the side-by-side table with the other #1753 PRs: https://github.com/Marvisak/VIctory/issues/1753#issuecomment-7172510623. Tested with the help of an AI assistant (Claude Code).
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/1780:upstream-pr/1780'
git switch 'upstream-pr/1780'

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