GPU: multisampled host textures have no unordered access #2351
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2353"
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?
Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T11:26:34Z.
What's wrong
host_desckeeps the console'sALLOW_UNORDERED_ACCESSon multisampled textures. It drops the flag only for depth targets. D3D12 says of that flag "Can't be used with MSAA textures" (D3D12_RESOURCE_FLAGS), so the host refuses such a texture and the title's texture has no host copy. With the flag on, sRGB multisampled textures are also made typeless for no reason, andlegal_forallows them the unordered-access state.What the fix does
The condition that drops
UNORDEREDfor depth targets inhost_descalso coverssample_count > 1.legal_forand the unordered-view check (descriptor::host::fits) already go by the host texture's flags, so multisampled textures leave the unordered-access state and get no unordered views. Single-sampled textures are unchanged.Tests
New device-free
resource::tests::msaa_textures_drop_unordered_access:legal_fordropsUNORDERED_ACCESSfrom its states;Results:
main(940d32f) it fails:left: 5,right: 1.resource::testspass (11 of 11, Wine 10, x86_64-pc-windows-msvc).Not tested
No title run, and no GPU run. Whether the title creates multisampled textures with the unordered flag is not measured; if it does, they currently have no host texture.
Fixes #2352
AI-assisted (Gemini 4 Neon found and wrote it, Claude Code reviewed, simplified and verified it). No game data used.
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T11:30:19Z.
Review: APPROVED
Verified against
origin/main(940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:UNORDEREDon multisampled host textures cleanly avoids invalid D3D12 resource descriptions.cargo test -p victory-gpu resource::tests: 11/11 passed on RTX 5090, 11/11 passed on WARP (includingmsaa_textures_drop_unordered_access).cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.cargo xtask policy: 183 files ok.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T11:52:02Z.
Review: COMMENTED
Multisampled host textures drop unordered access (same family as depth+UAV refusal). 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. Small correct fix with test.
Imported from Marvisak/VIctory. Originally posted by DrDarkDK on 2026-11-25T11:30:00Z.
I tested synthetic 32×32 committed render targets on native Windows with an RTX 4070 Ti (621.01) and WARP, with the D3D12 debug layer off and on. I verified that the debug info queue was active in the enabled runs.
Both backends behaved the same:
940d32f095aabcThis confirms the host descriptor correction on both backends. The parent did not reproduce a missing host texture in this fixture, even with the debug layer active. This was a resource-creation test only.
AI-assisted with Codex.
Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T11:32:25Z.
Thanks @DrDarkDK, that settles it the other way. The parent creating the 4x texture with both flags on an RTX 4070 Ti and on WARP means the host doesn't refuse the combination. Newer runtimes and drivers support writable MSAA textures (
D3D12_FEATURE_DATA_D3D12_OPTIONS14::WriteableMSAATexturesSupported), and the "Can't be used with MSAA textures" line in the flag docs predates that.So on hosts like these, this PR would take away unordered access the title can actually use, which is a regression rather than a fix. A correct version would drop the flag only when that option is false. That needs a new host capability query for old drivers alone, and nothing shows a title hitting it. I'm closing this PR and #2352. Thanks @DenRakEiw for the runs as well.
Pull request closed