GPU: create a texture without a host UAV format without the flag #2319

Open
github-bot wants to merge 2 commits from github-bot/gh-2319 into main AGit
Owner

@⁠Calvix2k on GitHub · 2026-11-25 10:33 UTC · original
Calvix2k:codex/gpu-uav-format-fallback-2307 → main · +63 −1 · 2 files · 2 commits · open

A texture the title creates with D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS in a format the host has no typed UAV for, and with no typeless family to stand in (B5G5R5A1_UNORM, and the console's two-byte formats that pass through as DXGI numbers), removes the device: on a strict driver GetResourceAllocationInfo fails with

D3D12_RESOURCE_DESC::Format is B5G5R5A1_UNORM; a texture that has ALLOW_UNORDERED_ACCESS must be created with a format that ... can be used as unordered access

as reported in #2307 on an RTX 3070 / Windows 10. The title then runs at 30 fps with a black screen.

What the fix does

host_desc drops ALLOW_UNORDERED_ACCESS for exactly those textures — no family to map to, and typed_store says the device cannot make a typed unordered view of the format — and logs a one-time warning naming the format. The texture is created, the title keeps running, and its unordered views are refused later by fits (the view half, #1763). Formats with a family are untouched: the sRGB mapping and the case where the device does store to the type keep the flag.

Verification

  • cargo test -p victory-gpu --features diagnostics --lib on Windows 10 19045 / RX 7800 XT: 146 passed, 1 failed — the known placed-view test on a runtime without ID3D12Device10 (#1999), identical on main; clippy -D warnings clean.
  • New test a_format_without_unordered_access_loses_the_flag covers the drop and the "keeps the flag" arm. On the AMD driver here typed_store reports true for 85/86/115, so the drop arm skips; that is why the device removal is NVIDIA-only in the report. It needs an NVIDIA or WARP run to be exercised for real.
**@⁠Calvix2k** on GitHub · 2026-11-25 10:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319) `Calvix2k:codex/gpu-uav-format-fallback-2307` → `main` · +63 −1 · 2 files · 2 commits · open A texture the title creates with `D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS` in a format the host has no typed UAV for, and with no typeless family to stand in (`B5G5R5A1_UNORM`, and the console's two-byte formats that pass through as DXGI numbers), removes the device: on a strict driver `GetResourceAllocationInfo` fails with ``` D3D12_RESOURCE_DESC::Format is B5G5R5A1_UNORM; a texture that has ALLOW_UNORDERED_ACCESS must be created with a format that ... can be used as unordered access ``` as reported in #2307 on an RTX 3070 / Windows 10. The title then runs at 30 fps with a black screen. ### What the fix does `host_desc` drops `ALLOW_UNORDERED_ACCESS` for exactly those textures — no family to map to, and `typed_store` says the device cannot make a typed unordered view of the format — and logs a one-time warning naming the format. The texture is created, the title keeps running, and its unordered views are refused later by `fits` (the view half, #1763). Formats with a family are untouched: the sRGB mapping and the case where the device does store to the type keep the flag. ### Verification - `cargo test -p victory-gpu --features diagnostics --lib` on Windows 10 19045 / RX 7800 XT: **146 passed, 1 failed** — the known placed-view test on a runtime without `ID3D12Device10` (#1999), identical on `main`; clippy `-D warnings` clean. - New test `a_format_without_unordered_access_loses_the_flag` covers the drop and the "keeps the flag" arm. On the AMD driver here `typed_store` reports true for 85/86/115, so the drop arm skips; that is why the device removal is NVIDIA-only in the report. It needs an NVIDIA or WARP run to be exercised for real.
Part of #2307 (the allocation half; #1763 covers the view half).

A texture the title creates with `D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS` in a format the host has no typed UAV for, and that has no typeless family to stand in (`B5G5R5A1_UNORM`, and the console's two-byte formats that pass through as DXGI numbers), removes the device at `GetResourceAllocationInfo` on a strict driver: "a texture that has ALLOW_UNORDERED_ACCESS must be created with a format that ... can be used as unordered access". `host_desc` now drops the flag for exactly those formats with a one-time warning, so the texture is created and the title keeps running; its unordered views are refused later by `fits` (#1763), instead of the device disappearing.

Formats with a family are untouched: the sRGB case keeps its existing mapping, and a format whose type the device stores to keeps the flag.

## Verification

- `cargo test -p victory-gpu --features diagnostics --lib` on Windows 10 19045 / RX 7800 XT: 146 passed, 1 failed — the known placed-view test on a runtime without `ID3D12Device10` (#1999), identical on `main`; clippy `-D warnings` clean.
- `a_format_without_unordered_access_loses_the_flag` checks the new arm and the "keeps the flag" arm. It skips where the device does report a typed UAV for those formats — this AMD driver does (85, 86, 115 all true here), which is why the removal is NVIDIA-only in the reports; the drop needs an NVIDIA/WARP run to be exercised.
Review feedback on #2319: `family(f) == f` is also true for every typeless
format, so the new drop would have taken `ALLOW_UNORDERED_ACCESS` from sRGB
textures the block above just made typeless (29 -> 27, 91 -> 90, 93 -> 92)
and from typeless UAV textures of the title's own (R32_TYPELESS). Their
unordered views would then be refused by `descriptor::host::fits`, a
regression from `main`.

Use the test `fits` uses for "no family at all": `family(f) == f &&
family(f + 1) != f`. The test now also checks that an sRGB UAV texture (29)
keeps the flag and comes out as its typeless family 27; that assertion runs
before the device-dependent early return, so it is checked on AMD too. Move
the test inside `mod tests` (it sat after the module's closing brace).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:02:09 +00:00
Author
Owner

@⁠qtLkz on GitHub · 2026-11-25 12:40 UTC · original

Ran the drop arm on NVIDIA, with the output visible: RTX 4070 Ti (Ada), driver 621.01, Windows 11 Pro build 26300, Rust 1.98.1 pinned, this PR on top of main 940d32f.

cargo test -p victory-gpu --lib --locked a_format_without_unordered_access_loses_the_flag -- --nocapture
running 1 test
test resource::a_format_without_unordered_access_loses_the_flag ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 145 filtered out

No this device stores to 86 as a typed UAV; skipped line was printed, so on this card typed_store(86) is false and the test really took the drop arm: format 86 with ALLOW_UNORDERED_ACCESS comes back from host_desc without the flag and still as 86. The "28 keeps the flag" arm ran as well (no assertion failed).

This matters because the test returns early as a pass when the device does report a typed UAV for 86 (as on the RX 7800 XT above), so a bare "1/1 passed" does not by itself show the new arm ran. With --nocapture, the missing skip line does show it.

Same nit as above: the test sits just outside mod tests (its path is resource::a_format_without_unordered_access_loses_the_flag), harmless.

AI-assisted (Claude).

**@⁠qtLkz** on GitHub · 2026-11-25 12:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#issuecomment-7162699247) Ran the drop arm on NVIDIA, with the output visible: RTX 4070 Ti (Ada), driver 621.01, Windows 11 Pro build 26300, Rust 1.98.1 pinned, this PR on top of main `940d32f`. ``` cargo test -p victory-gpu --lib --locked a_format_without_unordered_access_loses_the_flag -- --nocapture running 1 test test resource::a_format_without_unordered_access_loses_the_flag ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 145 filtered out ``` No `this device stores to 86 as a typed UAV; skipped` line was printed, so on this card `typed_store(86)` is false and the test really took the drop arm: format 86 with `ALLOW_UNORDERED_ACCESS` comes back from `host_desc` without the flag and still as 86. The "28 keeps the flag" arm ran as well (no assertion failed). This matters because the test returns early as a pass when the device does report a typed UAV for 86 (as on the RX 7800 XT above), so a bare "1/1 passed" does not by itself show the new arm ran. With `--nocapture`, the missing skip line does show it. Same nit as above: the test sits just outside `mod tests` (its path is `resource::a_format_without_unordered_access_loses_the_flag`), harmless. AI-assisted (Claude).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:17 UTC · original · edited 2026-11-25 16:45 UTC

Automated triage for the maintainers.

Merge candidate (worth a look; small). resource.rs host_desc now drops ALLOW_UNORDERED_ACCESS only for a format with no family at all (family(f) == f && family(f + 1) != f, the same test descriptor::host::fits uses) that the host cannot use for typed unordered views (typed_store). This stops the device removal from #2307 for formats such as B5G5R5A1. Typeless heads (sRGB UAV textures turned typeless, R32_TYPELESS) keep the flag, so the gap from the previous review is closed. Their unordered views behave as on main. A refused view on a dropped format is then refused in fits, as the comment says. The test is inside mod tests now, and its sRGB assertion (29 keeps the flag and becomes 27) runs before the device-dependent early return, so it runs on every host. An RTX 4070 Ti run in this thread shows the drop arm executing. CI check: passing. Nit: resource.rs now ends with an extra blank line.

On your reply: confirmed. The condition and the test match what was asked.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:17 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#issuecomment-7166599752) · edited 2026-11-25 16:45 UTC <!-- victory-triage v1 head=3558858922580cf43af43ab3c3a983af2d85c298 verdict=merge-candidate at=2026-11-25T16:44:54Z --> Automated triage for the maintainers. **Merge candidate (worth a look; small).** `resource.rs` `host_desc` now drops `ALLOW_UNORDERED_ACCESS` only for a format with no family at all (`family(f) == f && family(f + 1) != f`, the same test `descriptor::host::fits` uses) that the host cannot use for typed unordered views (`typed_store`). This stops the device removal from #2307 for formats such as B5G5R5A1. Typeless heads (sRGB UAV textures turned typeless, R32_TYPELESS) keep the flag, so the gap from the previous review is closed. Their unordered views behave as on `main`. A refused view on a dropped format is then refused in `fits`, as the comment says. The test is inside `mod tests` now, and its sRGB assertion (29 keeps the flag and becomes 27) runs before the device-dependent early return, so it runs on every host. An RTX 4070 Ti run in this thread shows the drop arm executing. CI `check`: passing. Nit: `resource.rs` now ends with an extra blank line. On your reply: confirmed. The condition and the test match what was asked. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 16:15 UTC · original

The gap is fixed in 3558858 (rebased onto main 67e8ae1): the drop now needs family(f) == f && family(f + 1) != f, the same "no family at all" test fits uses, so typeless formats (sRGB UAVs turned typeless, R32_TYPELESS) keep ALLOW_UNORDERED_ACCESS and their unordered views stay as on main.

The test also covers that: an sRGB UAV texture (29) keeps the flag and comes out as its typeless family 27. I put that assertion before the device-dependent typed_store(86) early return so it runs on AMD too (here 86 answers true and the B5G5R5A1 half skips). The test is now inside mod tests.

Local: cargo test -p victory-gpu --features diagnostics --lib 146 passed / 2 ignored, plus the known placed-view failure (#1999); clippy -D warnings clean.

**@⁠Calvix2k** on GitHub · 2026-11-25 16:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#issuecomment-7167726253) The gap is fixed in `3558858` (rebased onto `main 67e8ae1`): the drop now needs `family(f) == f && family(f + 1) != f`, the same "no family at all" test `fits` uses, so typeless formats (sRGB UAVs turned typeless, R32_TYPELESS) keep `ALLOW_UNORDERED_ACCESS` and their unordered views stay as on `main`. The test also covers that: an sRGB UAV texture (29) keeps the flag and comes out as its typeless family 27. I put that assertion before the device-dependent `typed_store(86)` early return so it runs on AMD too (here 86 answers true and the B5G5R5A1 half skips). The test is now inside `mod tests`. Local: `cargo test -p victory-gpu --features diagnostics --lib` 146 passed / 2 ignored, plus the known placed-view failure (#1999); clippy `-D warnings` clean.
Author
Owner

@⁠davesousa on GitHub · 2026-11-25 19:18 UTC · original

In-game result on NVIDIA: RTX 3070 Ti (Ampere, 8 GB), driver 621.40, Windows 11 26200, 32 GB RAM. Title Series 1.0.2.1. diag build (--features diagnostics), after translate --cache --pipelines. This PR (3558858) merged onto main 13f91ca. On this card, a_format_without_unordered_access_loses_the_flag passes without its skip line, so the drop arm runs.

Build Result
main 13f91ca Host device removed about 35 s after start, during the first-boot screens, in 2 of 2 runs. With VICTORY_D3D12_DEBUG=1, the last messages before RemoveDevice (DXGI_ERROR_INVALID_CALL) are id=599 at GetResourceAllocationInfo (B5G5R5A1_UNORM with ALLOW_UNORDERED_ACCESS) and id=342 (typed UAV of B5G5R5A1_UNORM). This is the same as #2563 on an RTX 3070.
main + #2319 (3558858) No removal at that point. The log shows the PR's warning once (format=86). First-boot, legal and start screens run at 30 fps (33.3 ms/frame) for 6 minutes.

After the start screen, while loading into the world, the + #2319 run ended with a GPU hang: 0x887A0006, after a 10.5 s submission of 34 lists (TDR delay 8 s). The log shows 42 compute pipelines refused by the host before it. That looks like the known NVIDIA world hang (#1968, #2220), not this PR.

Also seen on both builds, unchanged by this PR: view heap capped at 1,000,000 (the title asks for 1,245,184; #1760), and the 2560x1440 format 115 render target refused (#797).

AI-assisted (Claude Code); the runs are on my machine.

**@⁠davesousa** on GitHub · 2026-11-25 19:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#issuecomment-7172114334) In-game result on NVIDIA: RTX 3070 Ti (Ampere, 8 GB), driver 621.40, Windows 11 26200, 32 GB RAM. Title Series 1.0.2.1. `diag` build (`--features diagnostics`), after `translate --cache --pipelines`. This PR (`3558858`) merged onto `main` `13f91ca`. On this card, `a_format_without_unordered_access_loses_the_flag` passes without its skip line, so the drop arm runs. | Build | Result | |---|---| | `main` `13f91ca` | Host device removed about 35 s after start, during the first-boot screens, in 2 of 2 runs. With `VICTORY_D3D12_DEBUG=1`, the last messages before `RemoveDevice` (`DXGI_ERROR_INVALID_CALL`) are id=599 at `GetResourceAllocationInfo` (B5G5R5A1_UNORM with `ALLOW_UNORDERED_ACCESS`) and id=342 (typed UAV of B5G5R5A1_UNORM). This is the same as #2563 on an RTX 3070. | | `main` + #2319 (`3558858`) | No removal at that point. The log shows the PR's warning once (`format=86`). First-boot, legal and start screens run at 30 fps (33.3 ms/frame) for 6 minutes. | After the start screen, while loading into the world, the + #2319 run ended with a GPU hang: `0x887A0006`, after a 10.5 s submission of 34 lists (TDR delay 8 s). The log shows 42 compute pipelines refused by the host before it. That looks like the known NVIDIA world hang (#1968, #2220), not this PR. Also seen on both builds, unchanged by this PR: view heap capped at 1,000,000 (the title asks for 1,245,184; #1760), and the 2560x1440 format 115 render target refused (#797). AI-assisted (Claude Code); the runs are on my machine.
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 (flag dropped, UAVs null), B4G4R4A4 target half still removes the device; no new failures in cargo test -p victory-gpu. 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/2319#issuecomment-7172519327) RTX 4060 Laptop (610.47), merged onto main 13f91cae: B5G5R5A1 UAV half **fixed** (flag dropped, UAVs null), B4G4R4A4 target half still removes the device; no new failures in `cargo test -p victory-gpu`. 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

@⁠qtLkz on GitHub · 2026-11-25 20:30 UTC · original

Re-ran the updated head (3558858) on the same NVIDIA setup: RTX 4070 Ti, driver 621.01, Windows 11 Pro build 26300, merged onto main 13f91ca (clean merge).

cargo test -p victory-gpu --lib --locked a_format_without_unordered_access_loses_the_flag -- --nocapture
test resource::tests::a_format_without_unordered_access_loses_the_flag ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 196 filtered out

Again no "skipped" line, so the drop arm for 86 ran. The new sRGB case (29 keeps the flag as typeless 27) passes too, and the test now sits inside mod tests (path resource::tests::...). Thanks for moving it.

AI-assisted (Claude).

**@⁠qtLkz** on GitHub · 2026-11-25 20:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#issuecomment-7173782564) Re-ran the updated head (`3558858`) on the same NVIDIA setup: RTX 4070 Ti, driver 621.01, Windows 11 Pro build 26300, merged onto main `13f91ca` (clean merge). ``` cargo test -p victory-gpu --lib --locked a_format_without_unordered_access_loses_the_flag -- --nocapture test resource::tests::a_format_without_unordered_access_loses_the_flag ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 196 filtered out ``` Again no "skipped" line, so the drop arm for 86 ran. The new sRGB case (29 keeps the flag as typeless 27) passes too, and the test now sits inside `mod tests` (path `resource::tests::...`). Thanks for moving it. AI-assisted (Claude).
Author
Owner

@⁠krcenov on GitHub · 2026-11-25 22:06 UTC · original

Tested this PR at 3558858 on an RTX 3070 (driver 32.0.16.1714), Windows 10 22H2 (19045). The only local change is an Agility SDK 1.620.2 export (D3D12SDKVersion/D3D12SDKPath), which Windows 10 needs; see #2563. It was a diag build with VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1.

  • Fixed: No device removal in a 5-minute run. On 940d32f without a fix, the device was removed at 40–66 s. It held a steady 30 fps on menus and loading screens.
  • Format 86 handled: The B5G5R5A1 texture is created without the unordered flag. The view is then refused instead of removing the device: view the host does not allow unordered=true format=86 flags=1.
  • Still reported, not fatal: The format-115 render target (id=817 / id=599, B4G4R4A4_UNORM) and NumDescriptors 2097152 (id=645).
**@⁠krcenov** on GitHub · 2026-11-25 22:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#issuecomment-7175948854) Tested this PR at `3558858` on an RTX 3070 (driver 32.0.16.1714), Windows 10 22H2 (19045). The only local change is an Agility SDK 1.620.2 export (`D3D12SDKVersion`/`D3D12SDKPath`), which Windows 10 needs; see #2563. It was a `diag` build with `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`. - **Fixed:** No device removal in a 5-minute run. On `940d32f` without a fix, the device was removed at 40–66 s. It held a steady 30 fps on menus and loading screens. - **Format 86 handled:** The B5G5R5A1 texture is created without the unordered flag. The view is then refused instead of removing the device: `view the host does not allow unordered=true format=86 flags=1`. - **Still reported, not fatal:** The format-115 render target (id=817 / id=599, B4G4R4A4_UNORM) and `NumDescriptors 2097152` (id=645).
Author
Owner

@⁠DenRakEiw on GitHub · 2026-11-25 10:42 UTC · original · approved these changes

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

  • Stripping UNORDERED in host_desc when a format has no typeless family and !descriptor::host::typed_store(d.format) (e.g. B5G5R5A1 / 86 on NVIDIA) cleanly avoids device removal while preserving UNORDERED for UAV-capable formats. (Minor nit: a_format_without_unordered_access_loses_the_flag is placed just outside mod tests { ... } at the bottom of resource.rs, though it compiles and runs cleanly.)
  • cargo test -p victory-gpu a_format_without_unordered_access_loses_the_flag: 1/1 passed on RTX 5090, 1/1 passed on WARP.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

**@⁠DenRakEiw** on GitHub · 2026-11-25 10:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#pullrequestreview-6056056043) · **approved these changes** Verified against `origin/main` (`940d32f`) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP: - Stripping `UNORDERED` in `host_desc` when a format has no typeless family and `!descriptor::host::typed_store(d.format)` (e.g. `B5G5R5A1` / 86 on NVIDIA) cleanly avoids device removal while preserving `UNORDERED` for UAV-capable formats. (Minor nit: `a_format_without_unordered_access_loses_the_flag` is placed just outside `mod tests { ... }` at the bottom of `resource.rs`, though it compiles and runs cleanly.) - `cargo test -p victory-gpu a_format_without_unordered_access_loses_the_flag`: 1/1 passed on RTX 5090, 1/1 passed on WARP. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 183 files ok. AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠catminou4 on GitHub · 2026-11-25 10:54 UTC · original · reviewed

A texture without a host UAV format is created without the unordered flag instead of removing the device (typed_store probe). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Ties to #2305/#2332 vendor workaround cluster for #1952-adjacent device removals.

**@⁠catminou4** on GitHub · 2026-11-25 10:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#pullrequestreview-6056243867) · **reviewed** A texture without a host UAV format is created without the unordered flag instead of removing the device (typed_store probe). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Ties to #2305/#2332 vendor workaround cluster for #1952-adjacent device removals.
Author
Owner

@⁠fyernald on GitHub · 2026-11-25 17:06 UTC · original · approved these changes

Checked on a host that's a little different from the ones in this thread: RTX 3080 (Ampere), driver 617.42, Windows 10 (19045), main 67e8ae1.

On this driver the UAV-flagged B5G5R5A1_UNORM texture doesn't remove the device. It fails differently. I placed one through create_placed and read it back with host_copy (local probe test):

host texture flags device
main not made (host_copy → None) – not removed
this PR made 0x0 (no ALLOW_UNORDERED_ACCESS) not removed

So on older drivers the same bug means the texture is simply missing, and this PR fixes that case too.

Negative control: with the host_desc change taken out and the new test kept, a_format_without_unordered_access_loses_the_flag fails here with 86 has no typed UAV (left: 4, right: 0). With the PR the test passes, and the full cargo test -p victory-gpu --lib --locked gives 193 passed, 3 failed. Those 3 also fail on main here: the heap cap (FIND-9) and the Windows 10 castable test (#1999). With #2462 merged on top, the results are the same.

This host has no ID3D12Device10. I also checked that sRGB UAV textures keep the flag, as on main (29 → 27 and 91 → 90, both still unordered). The PR's own sRGB assertion passes here too.

**@⁠fyernald** on GitHub · 2026-11-25 17:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#pullrequestreview-6061750424) · **approved these changes** Checked on a host that's a little different from the ones in this thread: **RTX 3080 (Ampere), driver 617.42, Windows 10 (19045)**, `main` `67e8ae1`. On this driver the UAV-flagged `B5G5R5A1_UNORM` texture doesn't remove the device. It fails differently. I placed one through `create_placed` and read it back with `host_copy` (local probe test): | | host texture | flags | device | |---|---|---|---| | `main` | **not made** (`host_copy` → `None`) | – | not removed | | this PR | made | `0x0` (no `ALLOW_UNORDERED_ACCESS`) | not removed | So on older drivers the same bug means the texture is simply missing, and this PR fixes that case too. Negative control: with the `host_desc` change taken out and the new test kept, `a_format_without_unordered_access_loses_the_flag` fails here with `86 has no typed UAV` (`left: 4`, `right: 0`). With the PR the test passes, and the full `cargo test -p victory-gpu --lib --locked` gives 193 passed, 3 failed. Those 3 also fail on `main` here: the heap cap (`FIND-9`) and the Windows 10 castable test (#1999). With #2462 merged on top, the results are the same. This host has no `ID3D12Device10`. I also checked that sRGB UAV textures keep the flag, as on `main` (29 → 27 and 91 → 90, both still unordered). The PR's own sRGB assertion passes here too.
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-26 18:53 UTC · original

Thanks for the Windows 10 run — that is the second independent confirmation that the Agility export is what makes 1.620.2 usable there (same picture on an RX 7800 XT: with the folder beside the executable the device is made and the title reaches the world; without it the runtime stops earlier).

For the record, the export form you used (D3D12SDKVersion/D3D12SDKPath) is the one we ship in #2563 as well; on this title it is the difference between shader model 6.5 and 6.6/6.8 on Windows 10.

**@⁠Calvix2k** on GitHub · 2026-11-26 18:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#issuecomment-7200956237) Thanks for the Windows 10 run — that is the second independent confirmation that the Agility export is what makes 1.620.2 usable there (same picture on an RX 7800 XT: with the folder beside the executable the device is made and the title reaches the world; without it the runtime stops earlier). For the record, the export form you used (`D3D12SDKVersion`/`D3D12SDKPath`) is the one we ship in #2563 as well; on this title it is the difference between shader model 6.5 and 6.6/6.8 on Windows 10.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 19:00 UTC · original · approved these changes

Reviewed 355885892258 merged cleanly onto 63bcca43.

The guard in crates/victory-gpu/src/resource.rs:1140-1153 (reusing descriptor::host::typed_store exposed at descriptor/host.rs:1331) cleanly avoids device removal on singleton non-UAV formats such as B5G5R5A1_UNORM:

  • Runs after BUFFER early-return (resource.rs:1108), depth-UAV stripping (resource.rs:1119), and sRGB-to-typeless promotion (resource.rs:1131), so buffers, depth textures, typeless families, and UAV-capable formats keep their existing behaviour.
  • Stripping UNORDERED ensures descriptor::host::fits (descriptor/host.rs:1270-1283) rejects subsequent unordered views cleanly rather than removing the device at resource creation.
  • Two minor non-blocking notes for future follow-ups: (1) d.format + 1 at resource.rs:1142 could use d.format.checked_add(1).is_none_or(|n| family(n) != d.format) to prevent debug overflow on u32::MAX; (2) non-typeless members of multi-format families that also lack typed UAV support (e.g., BC*, R32G32B32_*, B8G8R8X8_UNORM) are outside this singleton check and can be handled if titles ever request ALLOW_UNORDERED_ACCESS on them.

Hardware & D3D12 Debug Layer verification (RTX 5090 + Microsoft WARP, VICTORY_D3D12_DEBUG=1):

  • cargo xtask policy and cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --all-features) pass cleanly.
  • resource::tests::a_format_without_unordered_access_loses_the_flag passes on both RTX 5090 and WARP under VICTORY_D3D12_DEBUG=1.
  • Verified an additional Debug Layer probe calling create_committed + descriptor::host::make_view(View::Unordered) across non-UAV singletons (86 B5G5R5A1, 85 B5G6R5, 115 B4G4R4A4, 67 R9G9B9E5 — flag stripped and UAV cleanly refused) and UAV-capable formats (28 R8G8B8A8_UNORM, 27 R8G8B8A8_TYPELESS, 29 R8G8B8A8_UNORM_SRGB -> 27, 26 R11G11B10_FLOAT, 10 R16G16B16A16_FLOAT — flag retained and UAV created): GetDeviceRemovedReason().is_ok() and host.log_messages() == None on both RTX 5090 and WARP.
  • Verified clean 3-way co-merge with #2314 and #2358 on 63bcca43.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 19:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#pullrequestreview-6079267804) · **approved these changes** Reviewed `355885892258` merged cleanly onto `63bcca43`. The guard in `crates/victory-gpu/src/resource.rs:1140-1153` (reusing `descriptor::host::typed_store` exposed at `descriptor/host.rs:1331`) cleanly avoids device removal on singleton non-UAV formats such as `B5G5R5A1_UNORM`: - Runs after `BUFFER` early-return (`resource.rs:1108`), depth-UAV stripping (`resource.rs:1119`), and sRGB-to-typeless promotion (`resource.rs:1131`), so buffers, depth textures, typeless families, and UAV-capable formats keep their existing behaviour. - Stripping `UNORDERED` ensures `descriptor::host::fits` (`descriptor/host.rs:1270-1283`) rejects subsequent unordered views cleanly rather than removing the device at resource creation. - Two minor non-blocking notes for future follow-ups: (1) `d.format + 1` at `resource.rs:1142` could use `d.format.checked_add(1).is_none_or(|n| family(n) != d.format)` to prevent debug overflow on `u32::MAX`; (2) non-typeless members of multi-format families that also lack typed UAV support (e.g., `BC*`, `R32G32B32_*`, `B8G8R8X8_UNORM`) are outside this singleton check and can be handled if titles ever request `ALLOW_UNORDERED_ACCESS` on them. **Hardware & D3D12 Debug Layer verification** (RTX 5090 + Microsoft WARP, `VICTORY_D3D12_DEBUG=1`): - `cargo xtask policy` and `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--all-features`) pass cleanly. - `resource::tests::a_format_without_unordered_access_loses_the_flag` passes on both RTX 5090 and WARP under `VICTORY_D3D12_DEBUG=1`. - Verified an additional Debug Layer probe calling `create_committed` + `descriptor::host::make_view(View::Unordered)` across non-UAV singletons (`86 B5G5R5A1`, `85 B5G6R5`, `115 B4G4R4A4`, `67 R9G9B9E5` — flag stripped and UAV cleanly refused) and UAV-capable formats (`28 R8G8B8A8_UNORM`, `27 R8G8B8A8_TYPELESS`, `29 R8G8B8A8_UNORM_SRGB -> 27`, `26 R11G11B10_FLOAT`, `10 R16G16B16A16_FLOAT` — flag retained and UAV created): `GetDeviceRemovedReason().is_ok()` and `host.log_messages() == None` on both RTX 5090 and WARP. - Verified clean 3-way co-merge with `#2314` and `#2358` on `63bcca43`. LGTM.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 19:46 UTC · original

I merged your exact head 3558858 with current main and extended the existing format-86 test in 239d068. It checks the actual D3D12 allocation on a device that reports no typed UAV support for B5G5R5A1: format 86 remains native, the SRV holds the texture, the UAV slot is null, and the device remains healthy.

The test builds, both strict all-target Clippy configurations passed, and the repository policy check passed. The local test runner reported that it had no D3D12 host, so the allocation and view assertions still need a GPU run. These commands select the extended test:

cargo test --locked -p victory-gpu --lib a_format_without_unordered_access_loses_the_flag -- --nocapture --test-threads=1

Calvix2k, would you run it on one of the devices that originally reported no typed store support? A run through the body prints format 86: host texture, live SRV, null UAV. If you fold the test into another commit, please preserve its Git author or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 19:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/2319#issuecomment-7201946638) I merged your exact head `3558858` with current `main` and extended the existing format-86 test in [`239d068`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/239d0684340832739fbcde45f8807c811af626f2). It checks the actual D3D12 allocation on a device that reports no typed UAV support for B5G5R5A1: format 86 remains native, the SRV holds the texture, the UAV slot is null, and the device remains healthy. The test builds, both strict all-target Clippy configurations passed, and the repository policy check passed. The local test runner reported that it had no D3D12 host, so the allocation and view assertions still need a GPU run. These commands select the extended test: ```text cargo test --locked -p victory-gpu --lib a_format_without_unordered_access_loses_the_flag -- --nocapture --test-threads=1 ``` Calvix2k, would you run it on one of the devices that originally reported no typed store support? A run through the body prints `format 86: host texture, live SRV, null UAV`. If you fold the test into another commit, please preserve its Git author or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2319'
git switch 'github-bot/gh-2319'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2319'
git switch 'github-bot/gh-2319'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2319'
git switch 'main'
git merge --squash 'github-bot/gh-2319'
git switch 'main'
git merge --ff-only 'github-bot/gh-2319'
git switch 'main'
git merge 'github-bot/gh-2319'
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!2319
No description provided.