GPU: no typed unordered view in a format the host cannot store to #2462

Manually merged
github merged 2 commits from gh-pr/2462/head into gh-pr/2462/base 2026-11-26 05:06:38 +00:00
Owner

@⁠lhnizdo on GitHub · 2026-11-25 14:02 UTC · original
lhnizdo:pr/uav-format-support → main · +10 −0 · 1 files · 2 commits · merged 2026-11-25 21:57 UTC

fits() asks the host whether it can store to a typed unordered view's format (typed_store) only when the view is cast to another format family. A view in the texture's own format goes to CreateUnorderedAccessView unchecked.

On an NVIDIA card (Windows 10), the title makes unordered views of B5G5R5A1_UNORM textures, a format that card can't use for unordered access. The device was removed with DXGI_ERROR_INVALID_CALL during loading. The debug layer reported:

ID3D12Device::CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM) cannot be used with a Typed Unordered Access View. This is because the current graphics implementation does not even support this Format.

followed by RemoveDevice.

Every typed unordered view is now checked, whatever its family. One the host can't store to is not made, like other views the host doesn't allow ("an unordered view in a format the host cannot store", logged once), and its slot stays null.

Checked on that machine: the view is refused once, the device is no longer removed there, and the run (with the Agility SDK and heap-limit PRs) went from frame 128 to past frame 1,700. Clippy is clean and the victory-gpu tests are unchanged.

🤖 Generated with Claude Code. The change was written by Claude Code (Claude Opus 5.5) in my session; the commit carries a Co-Authored-By: Claude line.

**@⁠lhnizdo** on GitHub · 2026-11-25 14:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/2462) `lhnizdo:pr/uav-format-support` → `main` · +10 −0 · 1 files · 2 commits · merged 2026-11-25 21:57 UTC `fits()` asks the host whether it can store to a typed unordered view's format (`typed_store`) only when the view is cast to another format family. A view in the texture's own format goes to `CreateUnorderedAccessView` unchecked. On an NVIDIA card (Windows 10), the title makes unordered views of `B5G5R5A1_UNORM` textures, a format that card can't use for unordered access. The device was removed with `DXGI_ERROR_INVALID_CALL` during loading. The debug layer reported: > ID3D12Device::CreateUnorderedAccessView: The format (0x56, B5G5R5A1_UNORM) cannot be used with a Typed Unordered Access View. This is because the current graphics implementation does not even support this Format. followed by `RemoveDevice`. Every typed unordered view is now checked, whatever its family. One the host can't store to is not made, like other views the host doesn't allow ("an unordered view in a format the host cannot store", logged once), and its slot stays null. **Checked** on that machine: the view is refused once, the device is no longer removed there, and the run (with the Agility SDK and heap-limit PRs) went from frame 128 to past frame 1,700. Clippy is clean and the `victory-gpu` tests are unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code). The change was written by Claude Code (Claude Opus 5.5) in my session; the commit carries a `Co-Authored-By: Claude` line.
fits() asked the host whether it stores to a typed unordered view's
format only for views cast to another family. A view in the texture's
own format went to CreateUnorderedAccessView unchecked, and on an NVIDIA
card (Windows 10) the title's B5G5R5A1_UNORM unordered views, which that
card does not take, removed the device with DXGI_ERROR_INVALID_CALL
during loading (the debug layer: "The format (0x56, B5G5R5A1_UNORM)
cannot be used with a Typed Unordered Access View", then RemoveDevice).

Every typed unordered view is now checked: one the host cannot store to
is not made, as other views the host does not allow, and its slot stays
null.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018sSQTeDQ6Kc6DEkgPbAww8
Review of #2462: for a view of a typed texture in another format of its
family that is not castable, fits() makes the view in the texture's own
format, but the store check looked at the requested one. It now checks
the format the view is made in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:06:35 +00:00
github manually merged commit a1ac77f37a into gh-pr/2462/base 2026-11-26 05:06:38 +00:00
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 14:12 UTC · original

Complements #2442 rather than overlapping it: #2442 legalizes the resource flag at creation, this guards the view-creation side — a typed UAV descriptor in a store-incapable format (incl. a cast view format, via typed = view when nonzero) is refused before fits can pass it to the host, where creation removes the device the same way. The view == 0 && typeless exemption is consistent — fits already returns !typeless there, so this skips a probe/log that cannot change the outcome. Both halves are needed: the title can request a UAV view whose declared format differs from the texture format.

**@⁠kotekompotek** on GitHub · 2026-11-25 14:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7164917176) Complements #2442 rather than overlapping it: #2442 legalizes the resource flag at creation, this guards the view-creation side — a typed UAV descriptor in a store-incapable format (incl. a cast view format, via `typed = view` when nonzero) is refused before `fits` can pass it to the host, where creation removes the device the same way. The `view == 0 && typeless` exemption is consistent — `fits` already returns `!typeless` there, so this skips a probe/log that cannot change the outcome. Both halves are needed: the title can request a UAV view whose declared format differs from the texture format.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:57 UTC · original · edited 2026-11-25 18:46 UTC

Automated triage for the maintainers.

Merge candidate. In crates/victory-gpu/src/descriptor/host.rs, fits now refuses any typed unordered view whose format the host cannot store to (typed_store, D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW), including views in the texture's own format. Before, only views cast to another family were checked, and the debug-layer message in the description shows the device being removed for one in the texture's own format. I checked the new typed choice against the rest of fits. A typed texture's view is made in its own format unless the requested format is castable, and a typeless texture's view is made in the requested format. The typeless case with no format keeps its old result. The later check for cast views is now redundant but harmless. CI check passes. It complements whichever host_desc flag fix is chosen (#2442 / #2459).

On your reply: the earlier nit is addressed. The check now looks at the format the view is actually made in.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7167466649) · edited 2026-11-25 18:46 UTC <!-- victory-triage v1 head=a1ac77f37af067448ae9082fefd0fffabe9665ff verdict=merge-candidate at=2026-11-25T18:46:17Z --> Automated triage for the maintainers. **Merge candidate.** In `crates/victory-gpu/src/descriptor/host.rs`, `fits` now refuses any typed unordered view whose format the host cannot store to (`typed_store`, `D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW`), including views in the texture's own format. Before, only views cast to another family were checked, and the debug-layer message in the description shows the device being removed for one in the texture's own format. I checked the new `typed` choice against the rest of `fits`. A typed texture's view is made in its own format unless the requested format is castable, and a typeless texture's view is made in the requested format. The typeless case with no format keeps its old result. The later check for cast views is now redundant but harmless. CI `check` passes. It complements whichever `host_desc` flag fix is chosen (#2442 / #2459). On your reply: the earlier nit is addressed. The check now looks at the format the view is actually made in. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠lhnizdo on GitHub · 2026-11-25 18:07 UTC · original

Thanks for testing on the RTX 3080, @⁠fyernald, and for checking it together with #2319.

I've addressed the triage nit: the store check now looks at the format the view is actually made in. That's the texture's own format, unless the requested one is castable, which matches what fits does further down. Also rebased onto current main (13f91ca).

**@⁠lhnizdo** on GitHub · 2026-11-25 18:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7170472956) Thanks for testing on the RTX 3080, @⁠fyernald, and for checking it together with #2319. I've addressed the triage nit: the store check now looks at the format the view is actually made in. That's the texture's own format, unless the requested one is castable, which matches what `fits` does further down. Also rebased onto current `main` (13f91ca).
Author
Owner

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

RTX 4060 Laptop (610.47), merged onto main 13f91cae: B5G5R5A1 UAV half fixed (views refused), B4G4R4A4 target half still removes the device; no new failures. On Intel UHD the UAV half still fails because main gets no host texture there (creation refused), which a view check cannot help. 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/2462#issuecomment-7172521742) RTX 4060 Laptop (610.47), merged onto main 13f91cae: B5G5R5A1 UAV half **fixed** (views refused), B4G4R4A4 target half still removes the device; no new failures. On Intel UHD the UAV half still fails because main gets no host texture there (creation refused), which a view check cannot help. 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).
Author
Owner

@⁠lhnizdo on GitHub · 2026-11-25 21:01 UTC · original

Thanks @⁠KainanP for the RTX 4060 run and the side-by-side in #1753. The B5G5R5A1 unordered-view half being fixed with no new failures is exactly what this PR is for. The B4G4R4A4 render-target half, and Intel UHD where no host texture is made at all, need the creation-side fixes from the other #1753 PRs; a view check can't reach them.

**@⁠lhnizdo** on GitHub · 2026-11-25 21:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7174510950) Thanks @⁠KainanP for the RTX 4060 run and the side-by-side in #1753. The `B5G5R5A1` unordered-view half being fixed with no new failures is exactly what this PR is for. The `B4G4R4A4` render-target half, and Intel UHD where no host texture is made at all, need the creation-side fixes from the other #1753 PRs; a view check can't reach them.
Author
Owner

@⁠artor410 on GitHub · 2026-11-25 21:53 UTC · original

Tested on RTX 3070 Ti, driver 610.88, Windows 11 26300, rustc 1.98.1. main 13f91ca. Head a1ac77f (fast-forward on main).

  • cargo test -p victory-gpu (main: 193 passed, 2 failed: the known heap-cap pair dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views). With this PR: 193 passed, same 2 failed. No new test.
  • Probe (temporary test, not committed): 256x256 texture via create_placed with the UAV and/or RT flag, then descriptor::host::make_view(View::Unordered(..)) and Host::rtv(texture, None), then GetDeviceRemovedReason, one process per case. On main: UAV view of 86 or 115 crashes the test process (0xc0000005 inside the driver); RTV of 115 removes the device (0x887A0001); 115 with RT|UAV gets no host texture. CheckFeatureSupport here: 86 RT yes, typed UAV no; 115 RT no, typed UAV no.
  • With this PR: UAV views of 86 and 115 are null and the process survives. RTV of 115 still removes the device (0x887A0001); 115 with RT|UAV still gets no host texture.

UAV only: the B4G4R4A4 render-target half of #735 is not covered, and UAV writes are dropped. Same effect as #1946.

(Claude Code, Claude Opus 5.5.)

**@⁠artor410** on GitHub · 2026-11-25 21:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/2462#issuecomment-7175667071) Tested on RTX 3070 Ti, driver 610.88, Windows 11 26300, rustc 1.98.1. main 13f91ca. Head a1ac77f (fast-forward on main). - `cargo test -p victory-gpu` (main: 193 passed, 2 failed: the known heap-cap pair `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views`). With this PR: 193 passed, same 2 failed. No new test. - Probe (temporary test, not committed): 256x256 texture via `create_placed` with the UAV and/or RT flag, then `descriptor::host::make_view(View::Unordered(..))` and `Host::rtv(texture, None)`, then `GetDeviceRemovedReason`, one process per case. On main: UAV view of 86 or 115 crashes the test process (0xc0000005 inside the driver); RTV of 115 removes the device (0x887A0001); 115 with RT|UAV gets no host texture. `CheckFeatureSupport` here: 86 RT yes, typed UAV no; 115 RT no, typed UAV no. - With this PR: UAV views of 86 and 115 are null and the process survives. RTV of 115 still removes the device (0x887A0001); 115 with RT|UAV still gets no host texture. UAV only: the B4G4R4A4 render-target half of #735 is not covered, and UAV writes are dropped. Same effect as #1946. (Claude Code, Claude Opus 5.5.)
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!2462
No description provided.