Repository navigation
Conversation
The console makes any texture a target or unordered storage; the host refuses resources with uses their format cannot take -- the 16-bit packed ones on NVIDIA: B4G4R4A4 has no render target support and its and B5G5R5A1's unordered access is refused too (Marvisak#2725) -- and both the creation and a plain query of such a description removed the device: 14 of the 20 crashes in the report, one of them 13 s after launch. A format's uses now come from CheckFeatureSupport (cached), and a host description leaves the refused ones away: the texture is made without them (its shader reads work; on NVIDIA the render target clears of a B4G4R4A4 skip, on the formats that do take a use nothing changes). A render target or depth view of a texture made without its use is dropped (the view reads null) instead of made on a resource that does not allow it -- Host::rtv and Host::dsv say None, and set_targets, the clear of a render target and of depth leave such a target out, as they do one without a view. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
…ce does not store is held back found in review on Marvisak#2773 by fuzeofficial (verified on RTX 5090 and WARP): `CheckFeatureSupport` reports no uses for a TYPELESS format (and every sRGB de-promoted one, 27/90/92): the format names no format itself, its views do. Stripping by that report left such a texture without the render target use of the game's own sRGB targets. A typeless format now takes its description's uses instead of the report's, and only the render target use is stripped at creation -- the one whose resource the device refuses wholesale (B4G4R4A4 on NVIDIA, where it does (an E_INVALIDARG, no device removal), and what removes the device is a view of it: every typed unordered access view now names a format the device stores (own format and casts alike, the description's own format included), and one it does not (B5G5R5A1, B4G4R4A4) is held back -- reads null, writes dropped. Tests: the description of 86/115/87 agrees with the device on the render target use and keeps the unordered one; typeless 27/90/92 and a sRGB promotion keep theirs; `typed_store` agrees with the device for 86, 115 and 28. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
… render target's The unordered access the device refuses a resource of (the 16-bit packed formats on NVIDIA: B5G5R5A1's typed UAV, Marvisak#2725's CreateUnorderedAccessView step; Marvisak#2563) is left away in the hosted description, as the render target use's already was: the creation of such a resource fails (`E_INVALIDARG`, the log's `no host texture`, and under the debug layer a device removal), where without the use the texture is made and its shader reads work, its own-format unordered views held back in `descriptor::host::fits` as before. The device's answer to both usages is the same `CheckFeatureSupport` query, cached once for both. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
733ab02 to
208080e
Compare
|
Rebased onto main (61bfc77). The conflict was
|
kotekompotek
left a comment
There was a problem hiding this comment.
Heads-up on overlap: this is the same host_desc change as #2442 (mine, stacked differently — #2442 is on main, CI-green, and has already been through two maintainer-review rounds on exactly this logic). Worth a look at that history before this lands:
format_takes_unordered(format) here checks only the bare format. A title texture created typeless can still get a legal UAV view — the castable-formats list passed at CreateCommittedResource3 includes family members that DO store typed. On fyernald's Win10/RTX 3080 (no ID3D12Device10), checking only the bare format strips ALLOW_UNORDERED_ACCESS from the sRGB formats (29, 91) even though family member 28 stores typed and the texture's UAV view is legal — the exact regression #2442's first revision had. #2442's current version keeps the flag when a typeless family member can store typed, and drops it for standalone formats like 85/86 (no typeless base, so no legal cast path even where Device10 exists).
Also note GetResourceAllocationInfo sees only the bare desc — the cast list isn't visible there — so for a standalone UAV-flagged format the flag is still lethal regardless of Device10, which is what makes the typeless gate necessary rather than merely a probe.
The RTV/DSV Option guard on top is complementary and good — it's the view-side counterpart #2773 started.
|
Reviewed and tested
|
|
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Automated triage for the maintainers. Verdict: needs work. This PR is stacked on #2773, so it carries that PR's commits. On top of them,
The larger question is direction. #2626 (merge candidate) makes these same textures R8G8B8A8_UNORM so draws and clears to them still work, while this PR drops the uses. Please say whether this is meant as a fallback alongside #2626 or instead of it. Landing #2773 first would also shrink this diff to its own change. CI: passing ( Generated by Claude Code |
|
Merged onto current
With |
Stacked on #2773. Fixes the resource side of #2725's steps 1/3 (and #2563):
host_descleft the unordered access use in even when the device refuses aresource of the format for it — the 16-bit packed ones on NVIDIA,
B5G5R5A1typed UAV and
B4G4R4A4alike (the comment said the creation refusescleanly and only the views remove the device). A probe on an NVIDIA host
proves that wrong:
CreateCommittedResourceof such a description failsE_INVALIDARGwithout any debug layer (GetResourceAllocationInforeportsSizeInBytes = UINT64_MAX) — the log'sno host texture … (0x80070057)—and under the debug layer
GetResourceAllocationInfo(id=599) is an errorof its own, so the device is removed before any view is made
(#2725's step 3, #2563's
B5G5R5A1typed UAV removal).The use is now left away like the render target's:
format_takes_unorderedasks
CheckFeatureSupportforTYPED_UNORDERED_ACCESS_VIEW(a typelessformat names no format itself and takes any use, its views do); the query
is shared with
format_takes_render_target's cache, keyed by the use.Where the use goes, the texture is made and its shader reads work; its
own-format unordered views are held back in
descriptor::host::fitsasbefore, and a view of a castable format the device does store reads null
(#2442's flag-drop) instead of the creation killing the device.
Tests (RTX 5090):
a_target_of_a_format_the_device_refuses_the_use_of_is_made_without_it:the description agrees with the device on both uses now — each stays when
CheckFeatureSupportreports the use, and goes when it does not, for86/115/87, with the typeless and sRGB promotions unchanged.
an_unordered_use_the_device_refuses_is_made_without_it: a textureof 86 and of 115 with
RENDER_TARGET | UNORDEREDis placed, made onfirst use (where today the whole creation fails), and its host flags
follow the device's;
R8G8B8A8keeps its use.cargo test -p victory-gpu --lib--test-threads=1: 196 passed, 0failed but the 2 pre-existing >1M heap-cap baselines.
cargo clippy --workspace --all-targets --locked, and with--all-features: 0 warnings, both.Generated with Mistral Vibe.