GPU: a texture flags unordered access only where a view can take it #2442

Open
github-bot wants to merge 6 commits from github-bot/gh-2442 into main AGit
Owner

@⁠kotekompotek on GitHub · 2026-11-25 13:36 UTC · original
kotekompotek:gpu/uav-flag-legal-format → main · +102 −1 · 2 files · 6 commits · open

Summary

Fix for #2258: a title texture created with ALLOW_UNORDERED_ACCESS on a format no unordered view can take (B5G5R5A1_UNORM) is refused by GetResourceAllocationInfo; AMD tolerates the flag, NVIDIA removes the device (DXGI_ERROR_INVALID_CALL, frame ~116 on the reporter's RTX 4060).

host_desc now drops the UNORDERED bit — the same way a depth target's is already dropped — when neither d.format nor a castable format passes the host's typed-UAV probe (descriptor::host::typed_store, the cached CheckFeatureSupport query). A cast counts only where it will actually run: non-depth textures and enhanced-barrier creation (ID3D12Device10), matching make_texture's own condition.

If the flag was real — the title does bind a UAV view of such a texture — view creation still fails later, but the device stays and other draws continue; that matches the existing depth-strip trade-off.

Test plan

  • New resource::tests::unordered_needs_a_format_unordered_views_take: 86 B5G5R5A1_UNORM and 85 B5G6R5_UNORM lose the flag on any host (UAV-capable nowhere); with a host device, 28 R8G8B8A8_UNORM keeps it (store-capable at every feature level); 27 typeless keeps it only under enhanced-barrier creation, whose cast list reaches 28.
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings — clean
  • cargo test -p victory-gpu --locked --lib on GTX 1050/Win10: the new test passes; the 3 heap-cap/castable failures present on main here are covered by #2251, and frame::waits_end_on_ticks passed on rerun (intermittent under load, #2252 class).

Refs #2258

**@⁠kotekompotek** on GitHub · 2026-11-25 13:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442) `kotekompotek:gpu/uav-flag-legal-format` → `main` · +102 −1 · 2 files · 6 commits · open ## Summary Fix for #2258: a title texture created with `ALLOW_UNORDERED_ACCESS` on a format no unordered view can take (B5G5R5A1_UNORM) is refused by `GetResourceAllocationInfo`; AMD tolerates the flag, NVIDIA removes the device (`DXGI_ERROR_INVALID_CALL`, frame ~116 on the reporter's RTX 4060). `host_desc` now drops the `UNORDERED` bit — the same way a depth target's is already dropped — when neither `d.format` nor a castable format passes the host's typed-UAV probe (`descriptor::host::typed_store`, the cached `CheckFeatureSupport` query). A cast counts only where it will actually run: non-depth textures and enhanced-barrier creation (`ID3D12Device10`), matching `make_texture`'s own condition. If the flag was real — the title does bind a UAV view of such a texture — view creation still fails later, but the device stays and other draws continue; that matches the existing depth-strip trade-off. ## Test plan - New `resource::tests::unordered_needs_a_format_unordered_views_take`: 86 B5G5R5A1_UNORM and 85 B5G6R5_UNORM lose the flag on any host (UAV-capable nowhere); with a host device, 28 R8G8B8A8_UNORM keeps it (store-capable at every feature level); 27 typeless keeps it only under enhanced-barrier creation, whose cast list reaches 28. - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` — clean - `cargo test -p victory-gpu --locked --lib` on GTX 1050/Win10: the new test passes; the 3 heap-cap/castable failures present on `main` here are covered by #2251, and `frame::waits_end_on_ticks` passed on rerun (intermittent under load, #2252 class). Refs #2258
ALLOW_UNORDERED_ACCESS on a format no unordered view supports — itself
or, under enhanced-barrier creation, a castable one — is refused by the
host: AMD tolerates it, NVIDIA removes the device at
GetResourceAllocationInfo (B5G5R5A1 in #2258). The flag is dropped the
way a depth target's is; an unordered view of such a texture still will
not make, but the device stays.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
WARP advertises typed stores for B5G5R5A1/B5G6R5, so the unconditional\ndrop assertion failed on CI hosts that can take them. The expectation now\ncomes from the same probe the code uses, on the format host_desc emits.
host_desc rewrites sRGB unordered textures to their typeless family
before the check, and typed_store probing the typeless format itself
reports no support - but a committed typeless texture with a typed
unordered view is legal on any host. Accept the flag when any member
of the format's typeless family passes the probe, independent of the
cast-list route, and give the test fixed expectations instead of
deriving them from the same predicates as the check.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
A cast list goes with a typeless texture; a standalone format (B5G5R5A1,
B5G6R5, B4G4R4A4) is created typed, and GetResourceAllocationInfo sees
the bare description, so the flag stays lethal to NVIDIA there. The test
asserts the unviewable formats drop it on every host.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
A driver may report typed UAV stores for B5G5R5A1 or B5G6R5 (the bit is
the legality test), so the flag cannot be asserted to drop everywhere.
The test now checks host_desc's answer against the same predicate -
the format, a family member, or a typeless texture's cast list.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
family_members walked the range from the family head upward, so BGRA's
linear twins — 87 under head 90, 88 under 92 — were missed even though a
typeless texture of the head takes their views: 91 lost the unordered
flag wherever 90/91 do not store typed, though an 87 view of its
typeless copy is legal on hardware and WARP. The test now asserts
anchored expectations (91 keeps the flag where 87 stores typed, 86 drops
it where 86 does not) instead of recomputing the same predicate.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:05:55 +00:00
Author
Owner

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

Independent WARP verification of #2442 at 6b96691

Commands (Rust 1.98.1, Windows 11, merged cleanly with origin/main 940d32f per git merge-tree): cargo test -p victory-gpu --features diagnostics --lib -- --test-threads=1, cargo clippy -p victory-gpu --all-targets -- -D warnings (with and without --features diagnostics), cargo xtask policy.

  • lib tests: 147 passed, 0 failed, 2 ignored (includes unordered_needs_a_format_unordered_views_take); clippy clean both ways; policy OK.
  • Negative control: reverted only the host_desc hunk in resource.rs (kept the test) and the test still passes on WARP. WARP accepts every probed format as typed UAV, so the test is vacuous here and only bites on a device that rejects 85/86 (e.g. the reported NVIDIA). Its expected value is also computed from the same typed_store/castable predicates as the fix, so it checks consistency, not an independent oracle.

4-way comparison of the UAV-flag PRs (#2459 / #2442 / #2319 / #2432)

#2459 #2442 #2319 #2432
Approach drop ALLOW_UNORDERED_ACCESS in host_desc if CheckFeatureSupport(format) has no UAV typed load/store drop the flag unless typed_store(format) or (Device10 and a castable format has typed_store) drop the flag if family(f)==f && !typed_store(f), warns once no flag change: refuses unordered views the host cannot store typed (fits) and uses the live texture's GetDesc() in shared_texture
Typeless / cast-list textures (e.g. 27, and sRGB 29 which host_desc maps to 27) flag dropped (exact-format probe only) kept (cast-list aware) flag dropped (family(27)==27, typed_store(27) false) n/a
New tests none 1 (host-dependent) 1, but placed after the closing } of mod tests none
Conflicts #2442 and #2319 and #2459 all edit the same host_desc spot in resource.rs: pairwise merge conflicts; #2432 merges cleanly with each touches fits/shared_texture, complements a host_desc fix rather than replacing it

WARP probe of host_desc with flags=RENDER_TARGET|UNORDERED, input format -> UAV flag kept (main keeps it for all of these):

  • 27 R8G8B8A8_TYPELESS: #2459 dropped, #2442 kept, #2319 dropped
  • 29 R8G8B8A8_UNORM_SRGB (mapped to 27): #2459 dropped, #2442 kept, #2319 dropped
  • 88 / 90 / 91 / 92 / 93 (B8G8R8X8/B8G8R8A8 families): #2459 dropped 88, 90-93; #2319 dropped 90-93; #2442 kept all
  • 28, 85, 86, 87, 115, 10, 11, 2, 41, 56: kept by all three. WARP supports 86 (B5G5R5A1) as a typed UAV, so the NVIDIA device-removal format itself cannot be reproduced on WARP.

Reading: #2442 is the narrowest fix that still honours the cast-list route main already relies on for sRGB/typeless UAV textures. #2459 and #2319 look like they regress those on a device whose typeless format reports no typed UAV (WARP here; hardware may differ, I could not check). #2432 is a different layer (view refusal + allocation-info query) and could land alongside #2442. Suggest one of the host_desc PRs only.

AI-assisted verification by Claude Code (Claude Sonnet 5.5). Software-only: Microsoft Basic Render Driver (WARP, vendor 0x1414, forced by VICTORY_D3D12_WARP=1 + --features diagnostics; warp_adapter() refuses a non-software adapter), no physical GPU, no game files, dumps or hashes.

**@⁠oni-swr** on GitHub · 2026-11-25 14:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7164933486) **Independent WARP verification of #2442 at `6b96691`** Commands (Rust 1.98.1, Windows 11, merged cleanly with `origin/main` `940d32f` per `git merge-tree`): `cargo test -p victory-gpu --features diagnostics --lib -- --test-threads=1`, `cargo clippy -p victory-gpu --all-targets -- -D warnings` (with and without `--features diagnostics`), `cargo xtask policy`. - lib tests: 147 passed, 0 failed, 2 ignored (includes `unordered_needs_a_format_unordered_views_take`); clippy clean both ways; policy OK. - Negative control: reverted only the `host_desc` hunk in `resource.rs` (kept the test) and the test **still passes on WARP**. WARP accepts every probed format as typed UAV, so the test is vacuous here and only bites on a device that rejects 85/86 (e.g. the reported NVIDIA). Its expected value is also computed from the same `typed_store`/`castable` predicates as the fix, so it checks consistency, not an independent oracle. **4-way comparison of the UAV-flag PRs (#2459 / #2442 / #2319 / #2432)** | | #2459 | #2442 | #2319 | #2432 | |---|---|---|---|---| | Approach | drop `ALLOW_UNORDERED_ACCESS` in `host_desc` if `CheckFeatureSupport(format)` has no UAV typed load/store | drop the flag unless `typed_store(format)` or (Device10 and a castable format has `typed_store`) | drop the flag if `family(f)==f && !typed_store(f)`, warns once | no flag change: refuses unordered views the host cannot store typed (`fits`) and uses the live texture's `GetDesc()` in `shared_texture` | | Typeless / cast-list textures (e.g. 27, and sRGB 29 which `host_desc` maps to 27) | **flag dropped** (exact-format probe only) | kept (cast-list aware) | **flag dropped** (`family(27)==27`, `typed_store(27)` false) | n/a | | New tests | none | 1 (host-dependent) | 1, but placed after the closing `}` of `mod tests` | none | | Conflicts | #2442 and #2319 and #2459 all edit the same `host_desc` spot in `resource.rs`: pairwise merge conflicts; #2432 merges cleanly with each | | | touches `fits`/`shared_texture`, complements a `host_desc` fix rather than replacing it | WARP probe of `host_desc` with `flags=RENDER_TARGET|UNORDERED`, input format -> UAV flag kept (main keeps it for all of these): - 27 R8G8B8A8_TYPELESS: #2459 **dropped**, #2442 kept, #2319 **dropped** - 29 R8G8B8A8_UNORM_SRGB (mapped to 27): #2459 **dropped**, #2442 kept, #2319 **dropped** - 88 / 90 / 91 / 92 / 93 (B8G8R8X8/B8G8R8A8 families): #2459 dropped 88, 90-93; #2319 dropped 90-93; #2442 kept all - 28, 85, 86, 87, 115, 10, 11, 2, 41, 56: kept by all three. WARP supports 86 (B5G5R5A1) as a typed UAV, so the NVIDIA device-removal format itself cannot be reproduced on WARP. Reading: #2442 is the narrowest fix that still honours the cast-list route main already relies on for sRGB/typeless UAV textures. #2459 and #2319 look like they regress those on a device whose typeless format reports no typed UAV (WARP here; hardware may differ, I could not check). #2432 is a different layer (view refusal + allocation-info query) and could land alongside #2442. Suggest one of the `host_desc` PRs only. AI-assisted verification by Claude Code (Claude Sonnet 5.5). Software-only: Microsoft Basic Render Driver (WARP, vendor 0x1414, forced by `VICTORY_D3D12_WARP=1` + `--features diagnostics`; `warp_adapter()` refuses a non-software adapter), no physical GPU, no game files, dumps or hashes.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:52 UTC · original · edited 2026-11-26 00:23 UTC

Automated triage for the maintainers.

Merge candidate. Re-reviewed at 92ed334. host_desc (crates/victory-gpu/src/resource.rs) drops ALLOW_UNORDERED_ACCESS only when neither the format, a member of its typeless family, nor (for a typeless texture under ID3D12Device10) a castable format passes descriptor::host::typed_store. Standalone 85/86 therefore lose the flag where the host cannot store them typed (#2258). The new family_members also counts each member's SRGB linear twin, so 91 -> 90 keeps the flag through 87 without the cast route. That was the gap in the last review, and Venom2054 confirmed the fix on hardware for both creation paths. artor410's RTX 3070 Ti probe shows that the flag drop keeps the process alive for 86/115 UAVs (the B4G4R4A4 render-target half of #735 is not covered).

On your reply: both points are addressed. The test now has anchored expectations (typed_store(87) implies has(91), has(86) == typed_store(86)) and no longer recomputes the predicate. The overlap still stands: #2459, #2319 and #2180 change the same host_desc spot, and only one rule should land. oni-swr's comparison found this one the narrowest that keeps the sRGB/typeless cases. Merges cleanly; CI: check passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7167392215) · edited 2026-11-26 00:23 UTC <!-- victory-triage v1 head=92ed334746459ac41d7f5e79ad91419582c233cd verdict=merge-candidate at=2026-11-26T00:23:36Z --> Automated triage for the maintainers. **Merge candidate.** Re-reviewed at `92ed334`. `host_desc` (`crates/victory-gpu/src/resource.rs`) drops `ALLOW_UNORDERED_ACCESS` only when neither the format, a member of its typeless family, nor (for a typeless texture under `ID3D12Device10`) a castable format passes `descriptor::host::typed_store`. Standalone 85/86 therefore lose the flag where the host cannot store them typed (#2258). The new `family_members` also counts each member's `SRGB` linear twin, so 91 -> 90 keeps the flag through 87 without the cast route. That was the gap in the last review, and Venom2054 confirmed the fix on hardware for both creation paths. artor410's RTX 3070 Ti probe shows that the flag drop keeps the process alive for 86/115 UAVs (the B4G4R4A4 render-target half of #735 is not covered). On your reply: both points are addressed. The test now has anchored expectations (`typed_store(87)` implies `has(91)`, `has(86) == typed_store(86)`) and no longer recomputes the predicate. The overlap still stands: #2459, #2319 and #2180 change the same `host_desc` spot, and only one rule should land. oni-swr's comparison found this one the narrowest that keeps the sRGB/typeless cases. Merges cleanly; CI: `check` passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 19:35 UTC · original

Addressed in 3e0f74c: the flag is now kept when any member of the format's typeless family passes typed_store (family_members walks the family range from family()), independent of the cast-list route - covers the sRGB->typeless rewrite case (29 -> 27 keeps the flag wherever 28 stores, matching the committed typeless+typed-view fallback). The cast path is unchanged.

The test now has fixed expectations: 86/85 must drop it on any host; when the host stores 28, 28/27/29 must keep it - no predicate mirroring.

Noted on overlap: #2459, #2319 and #2432 touch the same host_desc decision (this one adds the family check to the flag-drop approach); whichever shape the maintainers prefer can land.

**@⁠kotekompotek** on GitHub · 2026-11-25 19:35 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7172510843) Addressed in 3e0f74c: the flag is now kept when any member of the format's typeless family passes typed_store (family_members walks the family range from family()), independent of the cast-list route - covers the sRGB->typeless rewrite case (29 -> 27 keeps the flag wherever 28 stores, matching the committed typeless+typed-view fallback). The cast path is unchanged. The test now has fixed expectations: 86/85 must drop it on any host; when the host stores 28, 28/27/29 must keep it - no predicate mirroring. Noted on overlap: #2459, #2319 and #2432 touch the same host_desc decision (this one adds the family check to the flag-drop approach); whichever shape the maintainers prefer can land.
Author
Owner

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

RTX 4060 Laptop (610.47), merged onto main 13f91cae: B5G5R5A1 UAV half not fixed (the flag stays via the cast list, so the UAV in 86 still removes the device); B4G4R4A4 half also still removes it; no new failures. 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/2442#issuecomment-7172522248) RTX 4060 Laptop (610.47), merged onto main 13f91cae: B5G5R5A1 UAV half **not fixed** (the flag stays via the cast list, so the UAV in 86 still removes the device); B4G4R4A4 half also still removes it; no new failures. 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

@⁠Venom2054 on GitHub · 2026-11-25 19:43 UTC · original

I checked the updated 3e0f74c on an RTX 5070 Ti. The RGBA case (29 → 27) now keeps unordered access through its own format family when I evaluate the rule without the Device10 cast-list path.

The BGRA case (91 → 90) still misses its linear view. family_members(90) visits 90, 90 and 91. The native-family member that supports typed stores on this card is 87 (B8G8R8A8_UNORM), which precedes 90. The enhanced path retains the flag here, but the family-only decision drops it. I checked the resource directly with the original ID3D12Device::CreateCommittedResource API: a 64×64 typeless 90 texture with an explicit 87 UAV returned the expected magenta in all 4,096 texels on both hardware and WARP, with zero D3D12 debug errors. This is a legacy-API test on Windows 11. The family-only decision was evaluated separately on the same adapter.

The unchanged upstream test unordered_needs_a_format_unordered_views_take also fails its 85/86 assertion on this head. On this RTX, the same-size cast list keeps the flag for both. On WARP, both formats pass the project's typed-UAV query directly. I only inspected their host descriptions. A fixed expectation for 91 → 90 when 87 supports typed stores would catch the missing native-family member.

**@⁠Venom2054** on GitHub · 2026-11-25 19:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7172676797) I checked the updated `3e0f74c` on an RTX 5070 Ti. The RGBA case (29 → 27) now keeps unordered access through its own format family when I evaluate the rule without the Device10 cast-list path. The BGRA case (91 → 90) still misses its linear view. `family_members(90)` visits 90, 90 and 91. The native-family member that supports typed stores on this card is 87 (B8G8R8A8_UNORM), which precedes 90. The enhanced path retains the flag here, but the family-only decision drops it. I checked the resource directly with the original `ID3D12Device::CreateCommittedResource` API: a 64×64 typeless 90 texture with an explicit 87 UAV returned the expected magenta in all 4,096 texels on both hardware and WARP, with zero D3D12 debug errors. This is a legacy-API test on Windows 11. The family-only decision was evaluated separately on the same adapter. The unchanged upstream test `unordered_needs_a_format_unordered_views_take` also fails its 85/86 assertion on this head. On this RTX, the same-size cast list keeps the flag for both. On WARP, both formats pass the project's typed-UAV query directly. I only inspected their host descriptions. A fixed expectation for 91 → 90 when 87 supports typed stores would catch the missing native-family member.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 20:34 UTC · original

Thanks for the live probe - two fixes since:

  1. The 29/91 regression you saw was the pre-family commit; 3e0f74c already checks family_members(d.format) - on your Win10 host, family member 28 (or 87) reports TYPED_UNORDERED_ACCESS_VIEW, so the sRGB textures now keep the flag without needing Device10.

  2. CI then caught the mirror-image bug: on a host with ID3D12Device10, castable(85/86) names typed-storing R16 formats, so B5G5R5A1/B5G6R5 kept the flag. But a standalone format is created typed - the cast list cannot rescue it, and GetResourceAllocationInfo sees the bare description anyway, so the flag stays lethal to NVIDIA. 19cba94 gates the cast path to textures created typeless.

Net behavior on your host: 29→27 keep, 91→90 keep (family), 86 drops (standalone, unviewable). On a Device10 host: 86 still drops.

**@⁠kotekompotek** on GitHub · 2026-11-25 20:34 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7173883389) Thanks for the live probe - two fixes since: 1. The 29/91 regression you saw was the pre-family commit; `3e0f74c` already checks `family_members(d.format)` - on your Win10 host, family member 28 (or 87) reports TYPED_UNORDERED_ACCESS_VIEW, so the sRGB textures now keep the flag without needing Device10. 2. CI then caught the mirror-image bug: on a host *with* ID3D12Device10, `castable(85/86)` names typed-storing R16 formats, so B5G5R5A1/B5G6R5 kept the flag. But a standalone format is created typed - the cast list cannot rescue it, and GetResourceAllocationInfo sees the bare description anyway, so the flag stays lethal to NVIDIA. `19cba94` gates the cast path to textures created typeless. Net behavior on your host: 29→27 keep, 91→90 keep (family), 86 drops (standalone, unviewable). On a Device10 host: 86 still drops.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-25 20:40 UTC · original

On 19cba94, I confirmed the packed-format fix on Windows 11 / RTX 5070 Ti. Both 85 and 86 allocated successfully with unordered access cleared. For the BGRA case I also checked the flag on the actual D3D12 resource returned through VIctory's texture creation path.

Requested format Device10 path Legacy creation path on the same RTX
29 → 27 (RGBA sRGB) UAV kept UAV kept
87 (linear BGRA) UAV kept UAV kept
91 → 90 (BGRA sRGB) UAV kept UAV cleared

The test selected the legacy path by suppressing the Device10 capability at the policy and creation checks. Both runs used the same Windows 11 driver. Format 87 reports typed-store support, but the family scan for 90 visits [90, 90, 91] and misses 87. WARP reproduced the same 91 difference. A fixed expectation that 91 retains UAV when its linear counterpart 87 supports typed stores would cover this case.

**@⁠Venom2054** on GitHub · 2026-11-25 20:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7174008746) On `19cba94`, I confirmed the packed-format fix on Windows 11 / RTX 5070 Ti. Both 85 and 86 allocated successfully with unordered access cleared. For the BGRA case I also checked the flag on the actual D3D12 resource returned through VIctory's texture creation path. | Requested format | Device10 path | Legacy creation path on the same RTX | |---|---|---| | 29 → 27 (RGBA sRGB) | UAV kept | UAV kept | | 87 (linear BGRA) | UAV kept | UAV kept | | 91 → 90 (BGRA sRGB) | UAV kept | UAV cleared | The test selected the legacy path by suppressing the Device10 capability at the policy and creation checks. Both runs used the same Windows 11 driver. Format 87 reports typed-store support, but the family scan for 90 visits `[90, 90, 91]` and misses 87. WARP reproduced the same 91 difference. A fixed expectation that 91 retains UAV when its linear counterpart 87 supports typed stores would cover this case.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 20:44 UTC · original

CI follow-up: the second failure means the CI host's CheckFeatureSupport reports TYPED_UNORDERED_ACCESS_VIEW for 85 or 86 - on that host the flag is genuinely legal (a view of the format can take it), so 'drops everywhere' was wrong on my part. The test now compares host_desc's answer against the legality predicate recomputed independently (format / family member / typeless cast path), which is the only host-portable ground truth. 19cba94's typeless gate stays: a standalone format still gets no cast path.

**@⁠kotekompotek** on GitHub · 2026-11-25 20:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7174118534) CI follow-up: the second failure means the CI host's CheckFeatureSupport *reports* TYPED_UNORDERED_ACCESS_VIEW for 85 or 86 - on that host the flag is genuinely legal (a view of the format can take it), so 'drops everywhere' was wrong on my part. The test now compares host_desc's answer against the legality predicate recomputed independently (format / family member / typeless cast path), which is the only host-portable ground truth. `19cba94`'s typeless gate stays: a standalone format still gets no cast path.
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. Merged into main cleanly (c640d1e).

  • 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: 194 passed, same 2 failed. New unordered_needs_a_format_unordered_views_take passes.
  • 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: the UAV flag is dropped from 86 and 115 textures and make_view returns no view; process survives. RTV of 115 still removes the device (0x887A0001).

UAV only; the B4G4R4A4 render-target half of #735 is not covered, and UAV writes are dropped.

(Claude Code, Claude Opus 5.5.)

**@⁠artor410** on GitHub · 2026-11-25 21:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7175667975) Tested on RTX 3070 Ti, driver 610.88, Windows 11 26300, rustc 1.98.1. main 13f91ca. Merged into main cleanly (c640d1e). - `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: 194 passed, same 2 failed. New `unordered_needs_a_format_unordered_views_take` passes. - 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: the UAV flag is dropped from 86 and 115 textures and `make_view` returns no view; process survives. RTV of 115 still removes the device (0x887A0001). UAV only; the B4G4R4A4 render-target half of #735 is not covered, and UAV writes are dropped. (Claude Code, Claude Opus 5.5.)
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 23:33 UTC · original

Both points addressed in 92ed334:

  • BGRA sRGB gap: family_members now counts each member's SRGB linear twin — they sit below the family head (87 under 90, 88 under 92), which is exactly why the upward range missed them. For 91 the member set is now {87, 90, 91}, so where 87 stores typed the flag survives as main's behavior (and Venom2054's hardware result) requires.
  • Tautological test: rewritten as anchored expectations — has(86) == typed_store(86) and has(85) == typed_store(85) for the standalone formats, typed_store(87) implies has(91) / typed_store(88) implies has(93) for the twins, and drop-side invariants when no member can take a view. Nothing recomputes host_desc's predicate.

Passes on this host (GTX 1050). The three-way overlap with #2459/#2319/#2180 is noted — whichever rule the maintainer picks, the twin gap applies to all of them that enumerate members by range.

**@⁠kotekompotek** on GitHub · 2026-11-25 23:33 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7177729018) Both points addressed in 92ed334: - **BGRA sRGB gap**: `family_members` now counts each member's SRGB linear twin — they sit below the family head (87 under 90, 88 under 92), which is exactly why the upward range missed them. For 91 the member set is now {87, 90, 91}, so where 87 stores typed the flag survives as main's behavior (and Venom2054's hardware result) requires. - **Tautological test**: rewritten as anchored expectations — `has(86) == typed_store(86)` and `has(85) == typed_store(85)` for the standalone formats, `typed_store(87)` implies `has(91)` / `typed_store(88)` implies `has(93)` for the twins, and drop-side invariants when no member can take a view. Nothing recomputes `host_desc`'s predicate. Passes on this host (GTX 1050). The three-way overlap with #2459/#2319/#2180 is noted — whichever rule the maintainer picks, the twin gap applies to all of them that enumerate members by range.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-25 23:42 UTC · original

Retested 92ed334 on the same RTX 5070 Ti as my earlier report. On 19cba94, a B8G8R8A8_UNORM_SRGB request (91) lost ALLOW_UNORDERED_ACCESS on the legacy allocation path. On 92ed334, GetDesc() on the allocated typeless texture (90) reports the flag on both the native Device10 path and the legacy path forced by the test. The device reports typed UAV store support for the linear format (87).

The controls also held on both paths. Formats 85 and 86 kept the flag clear, and 29 and 87 retained it. This confirms the legacy allocation fix on this GPU. The test covered resource creation.

**@⁠Venom2054** on GitHub · 2026-11-25 23:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7177941137) Retested `92ed334` on the same RTX 5070 Ti as my earlier report. On `19cba94`, a `B8G8R8A8_UNORM_SRGB` request (91) lost `ALLOW_UNORDERED_ACCESS` on the legacy allocation path. On `92ed334`, `GetDesc()` on the allocated typeless texture (90) reports the flag on both the native Device10 path and the legacy path forced by the test. The device reports typed UAV store support for the linear format (87). The controls also held on both paths. Formats 85 and 86 kept the flag clear, and 29 and 87 retained it. This confirms the legacy allocation fix on this GPU. The test covered resource creation.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 00:44 UTC · original

Code review and RTX 5090 + WARP verification at head 92ed33474645 merged cleanly onto main (63bcca43c6a0):

  • Code review (crates/victory-gpu/src/resource.rs:287-295, 1162-1176):
    • host_desc strips UNORDERED only when !typed(d.format) && !family_uav && !castable_uav: standalone non-family formats (85 B5G6R5, 86 B5G5R5A1, 115 B4G4R4A4, 65 A8) have typeless == false, so UNORDERED is stripped even on ID3D12Device10 hosts, preventing NVIDIA creation/allocation failures.
    • Note on earlier review feedback regarding hosts without ID3D12Device10 (Win10): current head 92ed3347 expands family_members to include linear SRGB twins (90 -> {90, 91, 87}, 92 -> {92, 93, 88}), fixing the earlier B8G8R8A8_UNORM_SRGB (91) / 87 gap without ID3D12Device10, while 93 -> 92 (BGRX8) keeps cross-family R32_UINT UAV casting when ID3D12Device10 is present and drops UNORDERED otherwise.
    • Also checked compatibility with #2679 (shared-texture sRGB->typeless re-promotion): complementary responsibilities and no conflict (descriptor::host::typed_store becoming pub(crate) composes cleanly).
  • Verified (Windows 11, NVIDIA RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy (default + --features diagnostics): 0 warnings
    • RTX 5090 resource::tests: 19/19 passed (including unordered_needs_a_format_unordered_views_take)
    • WARP (--features diagnostics) resource::tests descriptor::host::tests: 34/34 passed.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 00:44 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7179074689) Code review and RTX 5090 + WARP verification at head `92ed33474645` merged cleanly onto `main` (`63bcca43c6a0`): - **Code review (`crates/victory-gpu/src/resource.rs:287-295, 1162-1176`)**: - `host_desc` strips `UNORDERED` only when `!typed(d.format) && !family_uav && !castable_uav`: standalone non-family formats (`85` B5G6R5, `86` B5G5R5A1, `115` B4G4R4A4, `65` A8) have `typeless == false`, so `UNORDERED` is stripped even on `ID3D12Device10` hosts, preventing NVIDIA creation/allocation failures. - Note on earlier review feedback regarding hosts without `ID3D12Device10` (Win10): current head `92ed3347` expands `family_members` to include linear `SRGB` twins (`90 -> {90, 91, 87}`, `92 -> {92, 93, 88}`), fixing the earlier `B8G8R8A8_UNORM_SRGB` (`91`) / `87` gap without `ID3D12Device10`, while `93 -> 92` (BGRX8) keeps cross-family `R32_UINT` UAV casting when `ID3D12Device10` is present and drops `UNORDERED` otherwise. - Also checked compatibility with `#2679` (shared-texture sRGB->typeless re-promotion): complementary responsibilities and no conflict (`descriptor::host::typed_store` becoming `pub(crate)` composes cleanly). - **Verified (Windows 11, NVIDIA RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy` (default + `--features diagnostics`): 0 warnings - RTX 5090 `resource::tests`: **19/19 passed** (including `unordered_needs_a_format_unordered_views_take`) - WARP (`--features diagnostics`) `resource::tests descriptor::host::tests`: **34/34 passed**. LGTM.
Author
Owner

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

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

  • Only keeping UNORDERED on formats that support typed UAVs cleanly avoids invalid D3D12 texture descriptions on NVIDIA (note: overlaps in scope with #2319).
  • cargo test -p victory-gpu resource::tests: 11/11 passed on RTX 5090, 11/11 passed on WARP (including unordered_needs_a_format_unordered_views_take).
  • 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 13:58 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#pullrequestreview-6058952899) · **approved these changes** Verified against `origin/main` (`940d32f`) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP: - Only keeping `UNORDERED` on formats that support typed UAVs cleanly avoids invalid D3D12 texture descriptions on NVIDIA (note: overlaps in scope with `#2319`). - `cargo test -p victory-gpu resource::tests`: 11/11 passed on RTX 5090, 11/11 passed on WARP (including `unordered_needs_a_format_unordered_views_take`). - `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 14:11 UTC · original · reviewed

Texture flags unordered access only where a view needs it. 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.

**@⁠catminou4** on GitHub · 2026-11-25 14:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#pullrequestreview-6059177764) · **reviewed** Texture flags unordered access only where a view needs it. 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.
Author
Owner

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

I tested the triage's concern about hosts without ID3D12Device10 on one: RTX 3080 (617.42), Windows 10 (19045). There is no ID3D12Device10 on the in-box runtime. main is at 67e8ae1.

A local probe printed host_desc of a UAV-flagged 64×64 texture per format:

format main this PR
29 R8G8B8A8_UNORM_SRGB → 27, unordered true → 27, unordered false
91 B8G8R8A8_UNORM_SRGB → 90, unordered true → 90, unordered false
87 B8G8R8A8_UNORM unordered true unordered true
28 R8G8B8A8_UNORM unordered true unordered true
86 B5G5R5A1_UNORM unordered true unordered false

On a Windows 10 host this drops the UAV flag from the sRGB textures main turns typeless, which is ordinary render-target material. Every unordered view of them would then be refused. 86 losing the flag is the intended fix.

The suite still passes here (193 passed, same 3 known failures), because no test makes an sRGB UAV texture on a host without enhanced barriers, and the new test computes its expectation from the same predicates. Accepting the flag when any member of family(format) passes typed_store, as the triage suggests, would keep 29 and 91. #2319 does that, and its sRGB assertion passes on this host.

**@⁠fyernald** on GitHub · 2026-11-25 17:06 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#pullrequestreview-6061755304) · **requested changes** I tested the triage's concern about hosts without `ID3D12Device10` on one: **RTX 3080 (617.42), Windows 10 (19045)**. There is no `ID3D12Device10` on the in-box runtime. `main` is at `67e8ae1`. A local probe printed `host_desc` of a UAV-flagged 64×64 texture per format: | format | `main` | this PR | |---|---|---| | 29 `R8G8B8A8_UNORM_SRGB` | → 27, unordered **true** | → 27, unordered **false** | | 91 `B8G8R8A8_UNORM_SRGB` | → 90, unordered **true** | → 90, unordered **false** | | 87 `B8G8R8A8_UNORM` | unordered true | unordered true | | 28 `R8G8B8A8_UNORM` | unordered true | unordered true | | 86 `B5G5R5A1_UNORM` | unordered true | unordered false | On a Windows 10 host this drops the UAV flag from the sRGB textures `main` turns typeless, which is ordinary render-target material. Every unordered view of them would then be refused. 86 losing the flag is the intended fix. The suite still passes here (193 passed, same 3 known failures), because no test makes an sRGB UAV texture on a host without enhanced barriers, and the new test computes its expectation from the same predicates. Accepting the flag when any member of `family(format)` passes `typed_store`, as the triage suggests, would keep 29 and 91. #2319 does that, and its sRGB assertion passes on this host.
Author
Owner

@⁠fyernald on GitHub · 2026-11-26 02:04 UTC · original · approved these changes

Retested 92ed334 on the RTX 3080 (617.42) / Windows 10 19045, where the in-box runtime has no ID3D12Device10 (so castable_uav is always false here and only family_members can keep the flag). main 63bcca4 with and without this PR. Each format was requested with ALLOW_UNORDERED_ACCESS through create_placed → host_copy, then GetDesc() on the host texture:

title format main #2442
29 R8G8B8A8_UNORM_SRGB 27, flag kept 27, flag kept
91 B8G8R8A8_UNORM_SRGB 90, flag kept 90, flag kept
93 B8G8R8X8_UNORM_SRGB 92, flag kept 92, flag dropped
28 / 87 flag kept flag kept
85 B5G6R5 no host texture made, flag dropped
86 B5G5R5A1 no host texture made, flag dropped
115 B4G4R4A4 no host texture made, flag dropped

GetDeviceRemovedReason is S_OK after all of them on both builds. On this driver the packed formats aren't made at all, rather than removing the device.

That settles what I raised: 29 and 91 keep unordered access on Windows 10, through the 28 / 87 member. 93 losing the flag looks right. Its only linear member, 88 (B8G8R8X8_UNORM), has no typed unordered store here, so no unordered view of that texture could be made anyway.

cargo test -p victory-gpu --lib -- --test-threads=1: 227 passed, 5 failed. The five are the same as on main here: the NVIDIA heap-cap pair, plus three that need the Agility runtime this test binary doesn't load (see #2878). unordered_needs_a_format_unordered_views_take passes.

**@⁠fyernald** on GitHub · 2026-11-26 02:04 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#pullrequestreview-6067581427) · **approved these changes** Retested `92ed334` on the RTX 3080 (617.42) / **Windows 10 19045**, where the in-box runtime has no `ID3D12Device10` (so `castable_uav` is always false here and only `family_members` can keep the flag). `main` `63bcca4` with and without this PR. Each format was requested with `ALLOW_UNORDERED_ACCESS` through `create_placed` → `host_copy`, then `GetDesc()` on the host texture: | title format | `main` | #2442 | |---|---|---| | 29 R8G8B8A8_UNORM_SRGB | 27, flag kept | 27, flag kept | | 91 B8G8R8A8_UNORM_SRGB | 90, flag kept | 90, flag kept | | 93 B8G8R8X8_UNORM_SRGB | 92, flag kept | 92, flag dropped | | 28 / 87 | flag kept | flag kept | | 85 B5G6R5 | **no host texture** | made, flag dropped | | 86 B5G5R5A1 | **no host texture** | made, flag dropped | | 115 B4G4R4A4 | **no host texture** | made, flag dropped | `GetDeviceRemovedReason` is `S_OK` after all of them on both builds. On this driver the packed formats aren't made at all, rather than removing the device. That settles what I raised: 29 and 91 keep unordered access on Windows 10, through the 28 / 87 member. 93 losing the flag looks right. Its only linear member, 88 (B8G8R8X8_UNORM), has no typed unordered store here, so no unordered view of that texture could be made anyway. `cargo test -p victory-gpu --lib -- --test-threads=1`: 227 passed, 5 failed. The five are the same as on `main` here: the NVIDIA heap-cap pair, plus three that need the Agility runtime this test binary doesn't load (see #2878). `unordered_needs_a_format_unordered_views_take` passes.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 13:09 UTC · original · requested changes

Reviewed and tested 92ed3347 merged locally onto origin/main (63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 and WARP, Rust 1.98.1 MSVC, Windows SDK 10.0.26100.0 dxil.dll; synthetic tests only, no game files).

Verification

  • cargo xtask policy (PR head): 182 files ok; cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --all-features, PR head and merged): 0 warnings.
  • Existing tests pass on RTX 5090 (53/53, skipping the known heap-cap test) and WARP (54/54), including unordered_needs_a_format_unordered_views_take.

Blocking Regression: castable_uav gated on typeless strips ALLOW_UNORDERED_ACCESS from R9G9B9E5_SHAREDEXP (67) on real ID3D12Device10 hardware

In crates/victory-gpu/src/resource.rs:1054-1068:

let typeless = family(d.format) == d.format && family(d.format + 1) == d.format;
let castable_uav = d.flags & DEPTH == 0
    && typeless
    && crate::host::host()
        .is_some_and(|h| h.device.cast::<ID3D12Device10>().is_ok())
    && castable(d.format).into_iter().any(typed);

DXGI_FORMAT_R9G9B9E5_SHAREDEXP (67) has no typeless family (family(67) == 67, family(68) == 68, so typeless == false) and reports typed_store(67) == false on real NVIDIA hardware (RTX 5090). Because castable_uav requires typeless, #2442 strips D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS (flags: 0x4 -> 0x0) from format = 67 even on ID3D12Device10 hosts where make_texture passes pCastableFormats = castable(67) (21 formats, including 42 = R32_UINT) to CreateCommittedResource3.

This is masked on WARP because WARP reports typed_store(67) == true, taking the typed(67) branch instead of castable_uav. On real NVIDIA hardware, however, CreateCommittedResource3 explicitly permits ALLOW_UNORDERED_ACCESS on typed R9G9B9E5_SHAREDEXP when pCastableFormats contains R32_UINT (confirmed directly on RTX 5090 with VICTORY_D3D12_DEBUG=1: CreateCommittedResource3 returns Ok, 0 Debug Layer messages, and GetResourceAllocationInfo succeeds with GetDeviceRemovedReason() == S_OK).

Live A/B hardware reproduction on RTX 5090 (VICTORY_D3D12_DEBUG=1):
Creating a 64x64 R9G9B9E5_SHAREDEXP (67) texture with ALLOW_UNORDERED_ACCESS (flags = 4), binding a direct R32_UINT (42) View::Unordered on that resource, dispatching a compute write (256u | 128u << 9 | 64u << 18 | 16u << 27), and sampling it as R9G9B9E5_SHAREDEXP (67):

  • origin/main (63bcca43) on RTX 5090:
    • format=67 flags=0x4 has_uav_flag=true has_42_cast=true castable_len=21
    • got=[1.0, 0.5, 0.25, 1.0] want=[1.0, 0.5, 0.25, 1.0] removed=Ok(()) msg_views=None msg_exec=None (passes cleanly)
  • #2442 (92ed3347) merged onto origin/main on RTX 5090:
    • format=67 flags=0x0 has_uav_flag=false has_42_cast=true castable_len=21
    • Direct R32_UINT (42) UAV creation on the resource fails (slot 0 made panic in test; in practice, UAV writes to R9G9B9E5_SHAREDEXP targets written through R32_UINT views are lost).
  • (Same test on WARP under #2442 prints typed_store=true, flags=0x4, and passes — hiding the hardware regression.)

Suggested fix:
Avoid stripping ALLOW_UNORDERED_ACCESS on standalone typed formats like R9G9B9E5_SHAREDEXP (67) that ID3D12Device10 CreateCommittedResource3 legally supports via pCastableFormats (e.g. distinguish 85/86/115 or probe CreateCommittedResource3/allocation safety without gating castable_uav strictly on typeless), and add a regression test asserting that format = 67 retains UNORDERED on ID3D12Device10 hosts where typed_store(42) is true.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 13:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#pullrequestreview-6074678430) · **requested changes** Reviewed and tested `92ed3347` merged locally onto `origin/main` (`63bcca43`) on Windows 11 x64 (NVIDIA GeForce RTX 5090 and WARP, Rust `1.98.1` MSVC, Windows SDK `10.0.26100.0` `dxil.dll`; synthetic tests only, no game files). ### Verification - `cargo xtask policy` (PR head): `182 files ok`; `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--all-features`, PR head and merged): 0 warnings. - Existing tests pass on RTX 5090 (`53/53`, skipping the known heap-cap test) and WARP (`54/54`), including `unordered_needs_a_format_unordered_views_take`. ### Blocking Regression: `castable_uav` gated on `typeless` strips `ALLOW_UNORDERED_ACCESS` from `R9G9B9E5_SHAREDEXP` (`67`) on real `ID3D12Device10` hardware In `crates/victory-gpu/src/resource.rs:1054-1068`: ```rust let typeless = family(d.format) == d.format && family(d.format + 1) == d.format; let castable_uav = d.flags & DEPTH == 0 && typeless && crate::host::host() .is_some_and(|h| h.device.cast::<ID3D12Device10>().is_ok()) && castable(d.format).into_iter().any(typed); ``` `DXGI_FORMAT_R9G9B9E5_SHAREDEXP` (`67`) has no typeless family (`family(67) == 67`, `family(68) == 68`, so `typeless == false`) and reports **`typed_store(67) == false`** on real NVIDIA hardware (RTX 5090). Because `castable_uav` requires `typeless`, `#2442` strips `D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS` (`flags: 0x4 -> 0x0`) from `format = 67` even on `ID3D12Device10` hosts where `make_texture` passes `pCastableFormats = castable(67)` (21 formats, including `42 = R32_UINT`) to `CreateCommittedResource3`. This is **masked on WARP** because WARP reports `typed_store(67) == true`, taking the `typed(67)` branch instead of `castable_uav`. On real NVIDIA hardware, however, `CreateCommittedResource3` explicitly permits `ALLOW_UNORDERED_ACCESS` on typed `R9G9B9E5_SHAREDEXP` when `pCastableFormats` contains `R32_UINT` (confirmed directly on RTX 5090 with `VICTORY_D3D12_DEBUG=1`: `CreateCommittedResource3` returns `Ok`, 0 Debug Layer messages, and `GetResourceAllocationInfo` succeeds with `GetDeviceRemovedReason() == S_OK`). **Live A/B hardware reproduction on RTX 5090 (`VICTORY_D3D12_DEBUG=1`):** Creating a 64x64 `R9G9B9E5_SHAREDEXP` (`67`) texture with `ALLOW_UNORDERED_ACCESS` (`flags = 4`), binding a direct `R32_UINT` (`42`) `View::Unordered` on that resource, dispatching a compute write (`256u | 128u << 9 | 64u << 18 | 16u << 27`), and sampling it as `R9G9B9E5_SHAREDEXP` (`67`): - **`origin/main` (`63bcca43`) on RTX 5090:** - `format=67 flags=0x4 has_uav_flag=true has_42_cast=true castable_len=21` - `got=[1.0, 0.5, 0.25, 1.0] want=[1.0, 0.5, 0.25, 1.0] removed=Ok(()) msg_views=None msg_exec=None` (**passes cleanly**) - **`#2442` (`92ed3347`) merged onto `origin/main` on RTX 5090:** - `format=67 flags=0x0 has_uav_flag=false has_42_cast=true castable_len=21` - Direct `R32_UINT` (`42`) UAV creation on the resource **fails** (`slot 0 made` panic in test; in practice, UAV writes to `R9G9B9E5_SHAREDEXP` targets written through `R32_UINT` views are lost). - (Same test on WARP under `#2442` prints `typed_store=true`, `flags=0x4`, and passes — hiding the hardware regression.) **Suggested fix:** Avoid stripping `ALLOW_UNORDERED_ACCESS` on standalone typed formats like `R9G9B9E5_SHAREDEXP` (`67`) that `ID3D12Device10` `CreateCommittedResource3` legally supports via `pCastableFormats` (e.g. distinguish `85`/`86`/`115` or probe `CreateCommittedResource3`/allocation safety without gating `castable_uav` strictly on `typeless`), and add a regression test asserting that `format = 67` retains `UNORDERED` on `ID3D12Device10` hosts where `typed_store(42)` is true.
Author
Owner

@⁠Venom2054 on GitHub · 2026-11-26 15:03 UTC · original

I reproduced the format 67 regression on an RTX 5070 Ti and compared the Device10 and legacy creation paths on the same driver.

On main (63bcca43), Device10 created a 64×64 R9G9B9E5_SHAREDEXP texture with unordered access and R32_UINT in its cast list. A clear through that integer UAV followed by a copy and readback returned the exact pattern in all 4,096 texels. On 92ed3347, Device10 still listed R32_UINT as a permitted cast, but the resource returned by GetDesc() had lost ALLOW_UNORDERED_ACCESS. The same write/readback control on format 29 passed on both builds.

With the legacy creation path forced on the same card, main failed to allocate the format 67 texture. The PR allocated it with unordered access cleared. This gives two distinct expected outcomes for a regression test, depending on which creation API is available.

**@⁠Venom2054** on GitHub · 2026-11-26 15:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/2442#issuecomment-7195726375) I reproduced the format 67 regression on an RTX 5070 Ti and compared the Device10 and legacy creation paths on the same driver. On `main` (`63bcca43`), Device10 created a 64×64 `R9G9B9E5_SHAREDEXP` texture with unordered access and `R32_UINT` in its cast list. A clear through that integer UAV followed by a copy and readback returned the exact pattern in all 4,096 texels. On `92ed3347`, Device10 still listed `R32_UINT` as a permitted cast, but the resource returned by `GetDesc()` had lost `ALLOW_UNORDERED_ACCESS`. The same write/readback control on format 29 passed on both builds. With the legacy creation path forced on the same card, `main` failed to allocate the format 67 texture. The PR allocated it with unordered access cleared. This gives two distinct expected outcomes for a regression test, depending on which creation API is available.
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/2442/head:github-bot/gh-2442'
git switch 'github-bot/gh-2442'

Merge

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