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

Open
github-bot wants to merge 1 commit from github-bot/gh-1780 into main AGit
Owner

@⁠LarryBebou on GitHub · 2026-11-24 22:25 UTC · original
LarryBebou:fix/unordered-view-host-format → main · +29 −1 · 1 files · 1 commits · open

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.

**@⁠LarryBebou** on GitHub · 2026-11-24 22:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/1780) `LarryBebou:fix/unordered-view-host-format` → `main` · +29 −1 · 1 files · 1 commits · open 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://git.gtahub.st/github/Marvisak--VIctory/issues/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.
fits() refused an unordered view the host cannot store to only when the
view was cast to another format family. A texture viewed in its own
format was never checked, so a B5G5R5A1_UNORM texture with unordered
access got a typed UAV of that format, which NVIDIA does not support:
the debug layer reports id 342 and the device is removed with
DXGI_ERROR_INVALID_CALL before the menus (#1754).

Each unordered view is now checked in the format it is made in: the
view's on a typeless or castable texture, the texture's otherwise.
Such a view stays null, so the title's writes to that texture are lost;
packed 16-bit formats need their own unordered path.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:44:29 +00:00
Author
Owner

@⁠DesertGamer on GitHub · 2026-11-24 22:34 UTC · original

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.

**@⁠DesertGamer** on GitHub · 2026-11-24 22:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/1780#issuecomment-7146392531) ### 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.*
Author
Owner

@⁠Vedoxdev123 on GitHub · 2026-11-24 22:56 UTC · original

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).

**@⁠Vedoxdev123** on GitHub · 2026-11-24 22:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/1780#issuecomment-7146819941) 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).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:18 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 06:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1780#issuecomment-7154649835) <!-- 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)_
Author
Owner

@⁠KainanP on GitHub · 2026-11-25 19:36 UTC · original

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: #1753. Tested with the help of an AI assistant (Claude Code).

**@⁠KainanP** on GitHub · 2026-11-25 19:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/1780#issuecomment-7172521293) 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://git.gtahub.st/github/Marvisak--VIctory/issues/1753. Tested with the help of an AI assistant (Claude Code).
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/descriptor/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1780/head:github-bot/gh-1780'
git switch 'github-bot/gh-1780'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1780'
git switch 'github-bot/gh-1780'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1780'
git switch 'github-bot/gh-1780'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1780'
git switch 'main'
git merge --squash 'github-bot/gh-1780'
git switch 'main'
git merge --ff-only 'github-bot/gh-1780'
git switch 'main'
git merge 'github-bot/gh-1780'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1780
No description provided.