Repository navigation
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:
- Stripping
UNORDEREDinhost_descwhen a format has no typeless family and!descriptor::host::typed_store(d.format)(e.g.B5G5R5A1/ 86 on NVIDIA) cleanly avoids device removal while preservingUNORDEREDfor UAV-capable formats. (Minor nit:a_format_without_unordered_access_loses_the_flagis placed just outsidemod tests { ... }at the bottom ofresource.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).
catminou4
left a comment
There was a problem hiding this comment.
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.
|
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 No 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 Same nit as above: the test sits just outside AI-assisted (Claude). |
|
Automated triage for the maintainers. Merge candidate (worth a look; small). On your reply: confirmed. The condition and the test match what was asked. Generated by Claude Code |
Part of Marvisak#2307 (the allocation half; Marvisak#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` (Marvisak#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` (Marvisak#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 Marvisak#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).
f908b04 to
3558858
Compare
|
The gap is fixed in 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 Local: |
fyernald
left a comment
There was a problem hiding this comment.
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.
|
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.
After the start screen, while loading into the world, the + #2319 run ended with a GPU hang: 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. |
|
RTX 4060 Laptop (610.47), merged onto main 13f91ca: B5G5R5A1 UAV half fixed (flag dropped, UAVs null), B4G4R4A4 target half still removes the device; no new failures in |
|
Re-ran the updated head ( 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 AI-assisted (Claude). |
|
Tested this PR at
|
A texture the title creates with
D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESSin 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 driverGetResourceAllocationInfofails withas 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_descdropsALLOW_UNORDERED_ACCESSfor exactly those textures — no family to map to, andtyped_storesays 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 byfits(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 --libon Windows 10 19045 / RX 7800 XT: 146 passed, 1 failed — the known placed-view test on a runtime withoutID3D12Device10(GPU tests: placed R32_UINT -> R9G9B9E5 view does not share its host texture (Windows 10, RX 7800 XT) #1999), identical onmain; clippy-D warningsclean.a_format_without_unordered_access_loses_the_flagcovers the drop and the "keeps the flag" arm. On the AMD driver heretyped_storereports 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.