GPU: drop ALLOW_UNORDERED_ACCESS when the format cannot be a UAV #2459
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2459
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2459"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@roon9e on GitHub · 2026-11-25 13:57 UTC · original
roon9e:fix/uav-format-without-support→main· +73 −2 · 2 files · 6 commits · openFixes the world-load device removal on a GTX 1660 SUPER (Turing, driver 610.88) that the #1063 report hit on
940d32f.The D3D12 debug layer named the invalid call:
The console allows a texture flagged for unordered access in such a packed format; PC D3D12 does not, so the resource creation is invalid and the next submission device-removes (
GetDeviceRemovedReason=0x887A0001).host_descnow asks the host device (D3D12_FEATURE_FORMAT_SUPPORT,UAV_TYPED_LOAD|UAV_TYPED_STORE) and dropsALLOW_UNORDERED_ACCESSwhen the format cannot be a UAV; its unordered views are then refused like any other use the host does not take.Measured on
940d32f(GTX 1660 SUPER, own 1.0.2.1 copy, Agility 1.620.2 inD3D12\):crashes.log:host GPU device removed … 0x887A0001);crashes.logclean) and reaches the account-picker screen at 30 fps, thenGame Running.This is independent of the codec stop in #1063 — with this change the run reaches that stop instead of dying earlier — and it is independent of pipelines/contents tried before (a pre-built
translate --cache --pipelineslibrary, Series S, and disabling depth twins or large title-buffer copies all still device-removed until this format guard).Thanks for VIctory.
@kotekompotek on GitHub · 2026-11-25 14:12 UTC · original
Heads-up for triage: #2442 fixes the same #2258 device removal, with two technical differences worth noting:
Support2UAV_TYPED_LOAD | UAV_TYPED_STORE(operation support). #2442 reuses the existingdescriptor::host::typed_store, which checksSupport1TYPED_UNORDERED_ACCESS_VIEW— the "can a typed UAV of this format exist" bit, which is the legality criterionALLOW_UNORDERED_ACCESScreation enforces (and is OR-ed here, so a load-only format would keep a flag it still cannot satisfy).d.formatitself; #2442 also accepts the flag whereID3D12Device10creation carries a cast list that can reach a typed-UAV format (the typeless → UNORM case), matching whattakes()will do later. Here the flag is dropped in a case the resource could legally keep.unordered_needs_a_format_unordered_views_take).@oni-swr on GitHub · 2026-11-25 14:12 UTC · original
Independent WARP verification of #2459 at
1679fbeCommands (Rust 1.98.1, Windows 11, merged cleanly with
origin/main940d32fpergit 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.uav_formatonly queries the exact format.4-way comparison of the UAV-flag PRs (#2459 / #2442 / #2319 / #2432)
ALLOW_UNORDERED_ACCESSinhost_descifCheckFeatureSupport(format)has no UAV typed load/storetyped_store(format)or (Device10 and a castable format hastyped_store)family(f)==f && !typed_store(f), warns oncefits) and uses the live texture'sGetDesc()inshared_texturehost_descmaps to 27)family(27)==27,typed_store(27)false)}ofmod testshost_descspot inresource.rs: pairwise merge conflicts; #2432 merges cleanly with eachfits/shared_texture, complements ahost_descfix rather than replacing itWARP probe of
host_descwithflags=RENDER_TARGET|UNORDERED, input format -> UAV flag kept (main keeps it for all of these):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_descPRs 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.@upipibi on GitHub · 2026-11-25 14:28 UTC · original · edited 2026-11-25 22:21 UTC
Overlap check: four open PRs drop
ALLOW_UNORDERED_ACCESSat resource creation invictory-gpu/src/resource.rs. Each uses a different rule for which formats lose the flag (read from the diffs againstmain940d32f, not run):TYPED_UNORDERED_ACCESS_VIEWsupport. It also strips unsupported render-target flags.family(f) == f: a typeless head, or a format with no family) and the host has no typed store for it (typed_store). Corrected: I first had this backwards.9ff2c1a) no typed store for the format and none for any format it can be cast to (castable(f).any(typed_store)); that's #2442's rule, except that #2442 doesn't allow the castable route for depth resourcesAdded 20:35Z: two newer PRs for #2725 overlap these (read from the diffs, not run):
c1fcd74) strips only the render-target use at creation, where the device refuses the resource (B4G4R4A4 on NVIDIA), and keeps the unordered-access use; typeless formats keep their description's uses; a typed UAV view whose format the device can't store (B5G5R5A1, B4G4R4A4) is held back (reads null, writes dropped), plusdraw.rs/host.rs/list.rschangesR8G8B8A8_UNORMwhen the host lacks render-target or typed UAV support for them; buffer-to-texture copies into such a texture are expanded on the CPU (list.rs), anddescriptor.rshandles the viewsAdded 21:52Z: two more, read from the diffs (not run):
host_descnow also drops the unordered-access use whenCheckFeatureSupportreports noTYPED_UNORDERED_ACCESS_VIEWfor the format (B5G5R5A1, B4G4R4A4 on NVIDIA), as #2773 does for the render-target use; typeless formats keep every use. Rebased onmain61bfc77, whosedescriptor::host::fitsalready holds back unordered views in formats the device doesn't store (the author's 21:46Z comment)resource.rsonly: where the host lacks render-target or typed UAV support, promotes 67 to 26, 115 to 87, and 86 to 87 (render target only), then drops a use the promoted format still lacks; a view now needs its exact format in the castable list rather than the same familySo #2834's unordered-access drop is the same creation-side change as the first four, with the device's own answer as the rule, and #2832 swaps formats like #2767 (87 there instead of 28).
Added 22:21Z: artor410 measured five of these on an RTX 3070 Ti with a synthetic probe (a UAV view of 86/115 and an RTV of 115, one process per case): #735. In it the RTV of 115 still removes the device with #2442, #2462 and #1946, not with #2767 or #2773. #2459, #2319, #2834 and #2832 are not in that table.
#2462 (lhnizdo) is the view-creation side. kotekompotek noted it complements #2442 rather than overlapping it.
They differ mainly for typeless formats. #2180 leaves typeless formats alone, #2319 applies its rule only to family heads (typeless ones included) and formats with no family, and #2442 keeps the flag when a castable UAV format exists. (Edited: the #2319 row was backwards.) One of the four should be picked; whichever is picked, #2462 still applies.
Edited after
9ff2c1a: #2459 and #2442 now use nearly the same rule. The difference is depth resources (#2442 keeps the castable route off for them).AI-assisted (Claude Code, Claude Opus 5.5). Read from the diffs only.
@roon9e on GitHub · 2026-11-25 14:49 UTC · original
Addressed the review feedback in
9ff2c1a(pushed to this branch).kotekompotek / oni-swr were right:
uav_formatprobed only the exact format withSupport2UAV_TYPED_LOAD | UAV_TYPED_STORE— an operation-support bit — so the flag was dropped from typeless and sRGB textures (R8G8B8A8_TYPELESS27, and 29 whichhost_descmaps to 27), plus the B8G8R8X8/B8G8R8A8 families, on any device whose typeless format reports no typed UAV.What changed:
host::uav_format;host_descnow uses the legality criteriondescriptor::host::typed_store(D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW, the bitALLOW_UNORDERED_ACCESScreation enforces), madepub(crate).castable(d.format), the enhanced-barrierCreateCommittedResource3listmake_texturealready passes) takes a typed unordered view. So typeless/sRGB textures that reach a typed-UAV format through the cast list keep the flag; the reportedB5G5R5A1_UNORMcase, whose family has no such format, still loses it.unordered_flag_follows_the_castable_route, asserting the flag matchestyped_store(f) || castable(f).any(typed_store)for27, 28, 29, 86, 87, 10.Checks (GTX 1660 SUPER, Turing, Rust 1.98.1):
cargo clippy -p victory-gpu --all-targets -- -D warningsclean; the new test passes against the real device. Note:cargo test -p victory-gpu --lib -- --test-threads=1has 2 pre-existing failures on this machine (dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views) — I reproduced them on1679fbewith this change stashed, so they are not from this PR.This brings the rule in line with #2442 (same criterion, cast-list aware). If the maintainers prefer #2442, I'm happy to close this one — the difference now is only surface (where the guard sits, and
typed_storeexposure).AI-assisted; verified on the physical Turing device noted above.
@Marvisak on GitHub · 2026-11-25 15:56 UTC · original · edited 2026-11-26 07:22 UTC
Automated triage for the maintainers.
The head is unchanged (
41bdc39), and thanks for passing on krcenov's RTX 3070 run. The open point from the last triage still stands: inhost_desc(resource.rs),family_formats(90)does not include the linear twin 87, so unordered BGRA sRGB (91) textures lose the flag thatmainkeeps. Verdict unchanged: needs work.Generated by Claude Code
@roon9e on GitHub · 2026-11-25 15:56 UTC · original
Updated this branch with two things:
origin/main(da82e44) so the PR is current (clean merge).9a47d4a: the committed fallback now clearsALLOW_UNORDERED_ACCESSwhen the cast-list creation is refused.host_desckeeps the flag where a castable format takes a typed UAV, but ifCreateCommittedResource3/CreatePlacedResource2with that list is refused and the plain fallback then carries the flag on a format that cannot be a typed UAV itself, the device is removed. With the cast list gone the flag is only legal where the format itself can take the view, so the fallback drops it there.Found while testing on the GTX 1660 SUPER: on
da82e44the world load now device-removes earlier, at a 2560×1440B4G4R4A4_UNORM(115) render target (no UAV flag) — separate from this PR and reproduced without it; reported on #2258.@roon9e on GitHub · 2026-11-25 16:06 UTC · original
Triage is right — thank you, that was a real bug in the change. Confirmed empirically on the GTX 1660 SUPER:
castablegroups by element size, socastable(B5G5R5A1_UNORM)reaches typed-UAV 16-bit formats and the flag was kept for 86 — i.e. it did not cover the texture the report is about, and the stable run was1679fbe, as you say.Fixed in
ce9d6fd:host_descnow uses the format's own family (family_formats, every format that shares itsfamily()head — the typeless head and its typed/sRGB twins), notcastable's element-size group.B5G5R5A1_UNORMhas no such family, so it loses the flag (the case is covered again); typeless/sRGB keep it through their typed member. The comment no longer claims the B5G5R5A1 case loses it under the old rule, and the test now asserts!family_takes(86)plus the rule for27/28/29/86/87/10, so a wrong rule fails it.9a47d4a's creation-fallback guard stays.On the re-run you suggested: I can't reach that texture on this head, because
da82e44device-removes earlier on this card — a 2560×1440B4G4R4A4_UNORM(115) render target (no UAV flag), reported on #2258 and reproduced without this change. On940d32fthe new predicate gives the same drop for 86 that was stable there.This now overlaps #2180/#2319/#2442 as you noted; I'm happy to close this in favour of whichever
host_descfix you pick.AI-assisted; probe and predicate on the physical Turing device above.
@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. By reading,assert!(!takes(86))would fail on hosts that store 86 (WARP, AMD). Details and the side-by-side table with the other #1753 PRs: #1753. Tested with the help of an AI assistant (Claude Code).@roon9e on GitHub · 2026-11-25 20:06 UTC · original
Fixed both triage points in
41bdc39.assert!(!takes(86))fromunordered_flag_follows_the_format_family. That assert encoded this device's support; WARP (and some AMD) storesB5G5R5A1_UNORMtyped and keeps the flag there, so the assert panicked on WARP. The test now pins only the rule,flag_kept == family_takes(format), for27/28/29/86/87/10.family_formats: it scanned only1..=115, so a format above 115 with no family iterated nothing rather than "falone" as its doc says. It now chainsfitself forf > 115, and the test assertsfamily_formats(200)contains200.Local:
cargo test -p victory-gpu --features diagnostics --lib resource::tests::unordered_flag_follows_the_format_familypasses on the GTX 1660 SUPER;cargo clippy -p victory-gpu --all-targets -- -D warningsclean with and without--features diagnostics.Still overlaps #2180/#2319/#2442; happy to close in favour of whichever
host_descfix is picked.AI-assisted.
@krcenov on GitHub · 2026-11-25 22:07 UTC · original
Tested this PR at
41bdc39on 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 adiagbuild withVICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1.940d32fwithout a fix, the device was removed at 40–66 s. It held a steady 30 fps on menus and loading screens.view the host does not allow unordered=true format=86 flags=1.NumDescriptors 2097152(id=645).@roon9e on GitHub · 2026-11-26 05:51 UTC · original
Thanks @krcenov — good to have an Ada confirmation at
41bdc39: no device removal, format 86 created without the unordered flag, and the view refused instead of the device going away. That matches what I see on the GTX 1660 SUPER.One note for anyone reading this PR: the format-115 /
id=817line you saw is unrelated to theid=817in #1063 (that one is a streaming codec id, not a resource id) — I chased both and they are different things.For the record, a separate finding from the same machine (not part of this PR, no code change here): the world-load stop at
+0x1330a44in #1063 loads on the software adapter (VICTORY_D3D12_WARP=1) and is broken on the 1660's D3D12 path — so it is a GPU-path issue, not the runtime's file/decode plumbing. Details in #1063. Nothing here changes this PR.AI-assisted.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.