Repository navigation
Conversation
A castable list naming a format the host does not have is refused whole, and the texture is then made without castable formats. vkd3d-proton (D3D12 on Vulkan, under Wine and Proton) has no `R10G10B10_XR_BIAS_A2_UNORM`, one of the 4-byte formats `castable` lists, so there every colour texture of that element lost its list, and title textures of one memory in other formats got their own host textures, bridged by copies. `make_texture` now keeps the formats the host reports support for (`CheckFeatureSupport`, asked once per format). A host that has every format, as Windows drivers do, keeps the same lists. New test: a render target with unordered views is castable to the formats of its element the host has. Under vkd3d-proton it fails before this change, and `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view` passes after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Do not let one unsupported DXGI format discard the rest of a texture's castable list. Source native vkd3d-proton tests cover the failure. Verified 59 portable GPU tests and the Windows workspace test build cross-check on the merged tree.
|
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at AI-assisted (Claude Code). |
|
Reviewed the I checked the two things a review of this change can check on hardware rather than by reading: whether the filter leaves the Windows lists exactly as they are, and whether the stricter test would have. On this machine (RTX 4090, driver
So the claim in the description holds here — a host that has every format keeps exactly today's lists — and it holds because the test is the loose one. The eight that the cast bit would have dropped are which is exactly the trap: Suggestion, and it is only documentation: say that in Two smaller things, both checked:
What I did not check: the Wine/Proton path, because this machine has no vkd3d-proton. The bug report and the fix are consistent with what vkd3d does (an unknown format refuses the whole No game data is involved: format numbers and support masks. Written with an AI assistant. |
|
Automated triage for the maintainers. In Generated by Claude Code |
|
Tested on Linux + Wine 11.22 + vkd3d-proton + NVIDIA RTX 3060 in Series S mode:
|
|
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of Verification (
|
|
NVIDIA + vkd3d-proton unit-test run, head Setup: Linux (Gentoo) / wine-proton 11.0.3 / vkd3d-proton 3.1, RTX 5080, NVIDIA 620.73.04; cross-built with cargo-xwin, rustc 1.98.1, native
Not run: the retail title or Windows. AI-assisted (Claude Code) |
|
Note 🤖 Claude Opus 5.5 responding on behalf of @arogan178 Verified on RDNA 4 under Proton: Setup: RX 9070 XT, RADV (Mesa 27.0-devel), Proton-CachyOS 11.0 with vkd3d-proton 3.2.0 from Proton Experimental, Windows SDK |
|
On NVIDIA under Wine this is what lights the scene. RTX 5090 (driver 620.73.04), Linux, Wine 11.22, vkd3d-proton 3.1-83 (GE-Proton11-14), DXVK vkd3d-proton has no
The prison yard at dusk is now lit through the cell window, for the first time on this setup. One run each, 7 and 12 minutes, no crash or Xid. AI-assisted (Claude); measured on my machine, no game data shared. |
fuzeofficlal
left a comment
There was a problem hiding this comment.
Reviewed and verified 4d8c89a8 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
git merge-treeagainstorigin/main(63bcca43): clean.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.- RTX 5090 (
VICTORY_D3D12_DEBUG=1,--features diagnostics):resource::tests+draw::tests— 39 passed, 0 failed (includinga_colour_target_is_castable_to_the_formats_the_host_hasanda_texture_written_in_one_format_reads_in_another_through_a_placed_view). - WARP (
VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1,--features diagnostics):resource::tests+draw::tests— 39 passed, 0 failed. - Format-support bit probe on RTX 5090 & WARP:
castable(28):Support1 != D3D12_FORMAT_SUPPORT1_NONEkeeps 21/21 on both RTX 5090 and WARP; requiringCAST_WITHIN_BIT_LAYOUTwould drop26(R11G11B10_FLOAT) and67(R9G9B9E5_SHAREDEXP) (19/21).castable(67):Support1 != NONEkeeps 21/21 on both adapters vs20/21(26dropped) withCAST_WITHIN_BIT_LAYOUT.
Review Notes
host_has(crates/victory-gpu/src/resource.rs:1172-1201) uses a lock-free[AtomicU8; 128]cache coveringcastable()'s entire1..=115range cleanly, and filtering viacastable_formats.retain(|&f| host_has(host, f))(:1228) preserves all native Windows castable lists while preventing a single unsupported format from failingCreateCommittedResource3whole.- Minor non-blocking notes:
a_colour_target_is_castable_to_the_formats_the_host_has(crates/victory-gpu/src/resource.rs:1897-1922) assumesID3D12Device10is present (t.castableis empty on Windows 10 without Agility SDK).- If merged alongside
#2389,#2389adds a 4thon_demand: boolparameter tomake_texture, so line 1915 in the new test will need, false.
Looks good to merge.
What
Under Wine and Proton, which run D3D12 on Vulkan through vkd3d-proton, the first castable colour texture logs:
With
VKD3D_DEBUG=warn, vkd3d-proton gives the reason:d3d12_resource_validate_usage: Unrecognized format #59. The number is hex, so this is format 89,R10G10B10_XR_BIAS_A2_UNORM. vkd3d-proton has no mapping for it; it's the only one of the 21 formatscastable(28)lists that's missing from its format table. One unknown format refuses the whole list. Every colour texture of that element is then made without castable formats, and title textures of one memory in other formats get their own host textures, bridged by copies.Change
make_texturekeeps only the castable formats the host reports support for:CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT)with a non-zeroSupport1, asked once per format and cached. A host that has every format, as Windows drivers do, keeps exactly the lists it has today. A host missing one loses only that format, not every list.Tests
resource::tests::a_colour_target_is_castable_to_the_formats_the_host_has. A 256×256R8G8B8A8_UNORMrender target with unordered access is made castable to the formats of its element that the host has. Under vkd3d-proton it fails onmain, with the warning above, and passes with this change.draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view. That is the case castable formats exist for.In the title, from VIctory's own texture counters in the log, comparing a world run before and after on the same Linux setup:
mainvictory-gputests on Linux, Wine 11.22 + vkd3d-proton master on RADV, RX 9070 XT:main130 ok / 12 failed, this branch 131 ok / 12 failed. The differences are the two tests above, plusdraw::tests::a_depth_texture_written_through_unordered_views_reads_as_depth, which fails onmainhere too when run alone (5 of 5).cargo clippy --workspace --all-targets [--all-features] -- -D warningsis clean.🤖 Generated with Claude Code