GPU: castable formats the host has #2099
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2101"
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 Deilach on 2026-11-25T04:59:18Z.
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
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T05:02:23Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Castable formats the host has — format-cast gating by host caps; pairs with the capability-gating cluster (#1775/#1787/#1801/#1832/#1843).
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T05:05:29Z.
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
4d8c89a.victory-gpu: 142 passed, 2 failed, 2 ignored. The newa_colour_target_is_castable_to_the_formats_the_host_haspasses. The 2 failures are #1744's heap-cap failures onmain. Same asmainon this hardware (native D3D12, so not the vkd3d-proton case this PR is about).AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-25T05:46:32Z.
Reviewed the
Support1 != 0choice by measuring it: it is the right one, and here is the trap it walks pastI 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
32.0.16.2124), for the 21 formatscastable(28)lists:Support1 != D3D12_FORMAT_SUPPORT1_NONE(what this PR uses)Support1 & CAST_WITHIN_BIT_LAYOUT(0x8000)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:
CAST_WITHIN_BIT_LAYOUTis the bit that says "this format may be cast to within its bit layout", and on this driver eight formats of the very list that is being filtered do not carry it while the host does make them castable in practice. Tightening the predicate later — and it reads like the tidier choice — would silently take 21 formats down to 13 on Windows, which is the opposite of what this change is for.Suggestion, and it is only documentation: say that in
host_has's comment, in the terms above. Something like "asked whether the host knows the format at all, not whether it can be cast: on Windows drivers 8 of the 21 formats ofcastable(28)do not carryCAST_WITHIN_BIT_LAYOUTand are still castable in practice, so the strict bit would halve the list". The code is right; the next person to "improve" it needs the number, not the principle.Two smaller things, both checked:
castable()iterates1..=115, so theHAS.get(format as usize)fallback tofalsecannot be reached by a format from this path. (I looked, because a fixed table with a silentfalseoutside its range is the kind of thing that bites later.)CheckFeatureSupportfor a format, for typed UAVs) is clean and builds — I tried it, in that order. Both ask the device once per format and cache; if the two caches are ever unified, that is a tidy-up for later and not a reason to hold either.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
EnhancedBarriersSupportedFormatslist), and I have no way to reproduce it here — so on that half I am reading, not measuring, and saying so.No game data is involved: format numbers and support masks.
Written with an AI assistant.
upstream-sync referenced this pull request2026-11-25 07:02:55 +00:00
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:38:38Z.
Automated triage for the maintainers.
In
resource.rs,make_texturenow passes only the castable formats the host reports.host_hasasksCheckFeatureSupport(FORMAT_SUPPORT)withSupport1 != NONEand caches the answer per format. Before, one unknown format (89 on vkd3d-proton) made the host refuse the whole list.takesalready readst.castable, so texture sharing follows the filtered list. On Windows drivers it is a no-op: a commenter measured 21 of 21 formats kept on an RTX 4090. The 128-entry cache coverscastable's1..=115. The motivation is Wine/Proton, but the code is host-neutral and adds no platform-specific path. CI has not run on this head.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by 0xKaji on 2026-11-25T19:40:20Z.
Tested on Linux + Wine 11.22 + vkd3d-proton + NVIDIA RTX 3060 in Series S mode:
title textures sharing one 5).CreateCommittedResource3still fails withE_INVALIDARG (0x80070057)on3840x2160 format 28 flags 5(the host refuses castable formats). Undervkd3d-proton, some format incastable(28)likely reportsTEXTURE2Dsupport while lackingRENDER_TARGET | UNORDERED_ACCESSsupport whenflags & 5is requested.Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T19:54:10Z.
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of
4d8c89a8(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo xtask policy: 184 files ok;cargo clippy --locked -p victory-gpu --all-targets(default &--features diagnostics): 0 warnings.VICTORY_D3D12_WARP=1,--features diagnostics --test-threads=1): 199 passed, 0 failed, 1 ignored (includinga_colour_target_is_castable_to_the_formats_the_host_has).resource::tests18 passed, 0 failed (includinga_colour_target_is_castable_to_the_formats_the_host_has);draw::tests11 passed.git merge-treewith #1406, #2462, and #2679.Review Notes
[AtomicU8; 128]cache (host_has) is bounds-safe over1..=115and thread-safe for the singleton host device, while keeping Windows castable formats intact (Support1 != NONEavoids dropping formats that Windows drivers accept for casting).Imported from Marvisak/VIctory. Originally posted by Kajanos on 2026-11-25T20:43:29Z.
NVIDIA + vkd3d-proton unit-test run, head
4d8c89a86amerged ontomain13f91caee2.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
d3dcompiler_47.main,draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_viewfails here (round 0: a placed texture). With this PR it passes in every run.victory-gpusuite 5 times: 191–192 passed. The remaining failures all also fail onmainin this environment:descriptor::host::…dynamic_slots_are_held_until_releasedandmemory::…lists_share_a_table_and_copies_keep_their_views(the vkd3d-proton heap is smaller thanHEAP_VIEWS)pipeline::librarytests (fixed by #1722)shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changedalso failed. It passed 5/5 when run alone and 4 more full runs, and this PR doesn't touch that code, so it looks like a timing flake and not a regression.Not run: the retail title or Windows.
AI-assisted (Claude Code)
Imported from Marvisak/VIctory. Originally posted by arogan178 on 2026-11-25T23:42:18Z.
Verified on RDNA 4 under Proton:
draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_viewfails onmain("round 0: one host texture") and passes with this PR.Setup: RX 9070 XT, RADV (Mesa 27.0-devel), Proton-CachyOS 11.0 with vkd3d-proton 3.2.0 from Proton Experimental, Windows SDK
d3dcompiler_4710.0.26100.victory-gpulib tests cross-built forx86_64-pc-windows-msvcfrommainat63bcca4merged with #1722 and #2101 (both merge cleanly): 232 passed, 0 failed.mainalone: 228 passed, 3 failed, the three named in these two PRs.Imported from Marvisak/VIctory. Originally posted by neonbyte1 on 2026-11-26T01:52:40Z.
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
dxgi. The base ismain219878aplus #2723, #1129, #1548, #233, #320, #439, #2118, #2703 and a Wine-compilable argument clamp (#2969).vkd3d-proton has no
R10G10B10_XR_BIAS_A2, so it refused every castable list VIctory passed (the host refuses castable formats, once at start). Without the list, the R9G9B9E5 textures with only the unordered-access flag can't be made at all: 51no host texture … format: 67 … flags: 4per run. These are the screen-probe GI resolve targets (three 2560x1440) and the light-probe textures. The GI resolve writes them through R32_UINT views, so they need the shared castable texture. With their writes lost, tiled deferred lighting read zeros, and the presented frame was black except emissive surfaces.no host texturelines (format 67)refuses castable formatsThe 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.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T13:09:27Z.
Review: APPROVED
Reviewed and verified
4d8c89a8merged locally ontoorigin/main(63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 and WARP, Rust1.98.1MSVC, Windows SDK10.0.26100.0dxil.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.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).VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1,--features diagnostics):resource::tests+draw::tests— 39 passed, 0 failed.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.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).#2389,#2389adds a 4thon_demand: boolparameter tomake_texture, so line 1915 in the new test will need, false.Looks good to merge.
Imported from Marvisak/VIctory. Originally posted by AIcelos on 2026-11-26T21:37:20Z.
Tested on Linux + NVIDIA (Wine) — this stack now boots GTA VI v1.0.2.1 to a running game window.
Setup that works today (merged all open PRs in branch
nvidia-wine):cargo xwin build --profile diag -p victory --features diagnostics --target x86_64-pc-windows-msvcd3d12.dll/d3d12core.dlland DXVKdxgi.dllfrom GE-Proton 11-14 copied tosystem32/,WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n,builtin"dxil.dll: Wine's built-in (Wine-mono) DXBC builder works; NVIDIA's Windowsdxil.dllcannot load under Wine and blocks vkd3d-proton. (The team gist "remove all D3D12/DXGI/DXIL + builtin override" fails on stock wine — wine 10 ships nod3d12.dllof its own.)dxcompiler_NN.dllfallback (Wine's is unversioned),IDxcContainerBuilderv1→v2→v3 retry, root-signature fallback,VICTORY_CACHE_DIR.Result on RTX 5090: window appears, swapchain presents (frame 2048+ in 90 s ≈ 20 fps diag build), all 49 ttpf + packs open via dstorage, XUserAddAsync offline user, 52 shaders translated through Wine's dxil→DXBC path. No crash.
The "XCL requires Windows" premise is wrong: the whole layer runs under Wine with vkd3d-proton; only the host tooling assumed Windows.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T22:50:30Z.
Review: APPROVED
LGTM — verified on RTX 5090 (Windows / D3D12) against
origin/main(63bcca4).cargo test -p victory-gpu --lib resource:: -- --test-threads=1: 19 passed, 0 failed (includinga_colour_target_is_castable_to_the_formats_the_host_has).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-27T01:24:41Z.
Matched Wine/RTX4060 confirmation of this capability filter: #3147
2eb38bb1185f1b1b077da398b8e435787c0c6356fails its new same-list R32_UINT-write/RGB9E5-sample fixture before dispatch; the same checkout with only this PR’s4d8c89a86ac968d9e7687bec6fafcd0b9eef2405host_has/retain change passes all four cases (128 pixel observations /512 float-bit components). Full commands, native-call diagnosis, exact provenance and logs: https://github.com/Marvisak/VIctory/pull/3147#issuecomment-7207254013. Diagnostic-relaxed vkd3d, not stock certification or a title fix. Separately ported only the filter onto our scoped-backing/paging stack: cross-format placed-view readback and one-missed-submission recovery both pass2/2 on the real adapter; no approximate format stand-ins adopted. No new title run.Mixed RAM-tested stack: same-list GPU gate and bounded title follow-through (27 November)
Ported the test-only
packed_lighting_uav_write_is_visible_to_a_same_list_rgb9e5_srvfixture onto our dirtyVIctory-pr2945-fixed(base3ed7d725, scoped #2519 backing/copy-only alias fixes, #2121 paging + fork stride fix, #189 lowering). Production contains only this PR's4d8c89a8castable-format capability filter, not #3147's broader production stack. The older Slots API required calling the existingdescriptor::host::make_viewfor the returned real resource; no expected pixels or identity assertions changed. All four format/flag combinations pass: formats67/42 × flags4/5, 128 pixel observations /512 float components, required physical RTX4060. Fresh test compile9.03s; GPU fixture0.67s. Also added #1701fb27a56dmode enumeration, whose actual-output ABI probe and parser group pass4/4.Fresh diagnostics release42.46s, executable SHA256
5b44393ac8a57a06e3240557099bf04a4ddaffa59506985a2f34eb7de6757ac0. Same Wine11/Linux6.17/RTX4060 Laptop8GiB/NVIDIA590.48.01/16GiB and diagnostic-relaxed vkd3d2576c0b4adfae4a+, not stock certification. File-backed XMem, copy-only (VICTORY_IN_PLACE=0), private Wine tmpfs; guards unchanged (9GiB/512MiB scope, 2048MiB global RAM floor,6000MiB GPU,10GiB disk).180s guarded run, A at20s: loading artwork45/90s, prologue card120s, black150/175s; deliberate wall stop137. Minimum availableRAM4998.5MiB, GPUpeak4488MiB, scopepeak6248.9MiB, diskmin12.071GiB. Zero host-texture creation refusals and zero upscaler missing-texture warnings, versus30 texture refusals (28×67,1×115,1×86) and one missing-texture warning in the prior pre-filter180s run. This is supporting runtime evidence, not a matched single-variable causal comparison: #1701 also changed, caches/progress were uncontrolled. No gameplay or frame-rate claim.
Remaining failures are separate:48 compute translation refusals, plus13 native pipeline refusals (nine surfaced as
0x8007000E, fourE_FAIL). The native log has NVVM compiler failures; graphics creation returns Vulkan-13(VK_ERROR_UNKNOWN), which this vkd3d graphics path collapses toE_OUTOFMEMORY. Do not interpret that HRESULT alone as exhausted host RAM or this texture fix failing.Evidence:
verify-scoped-lighting-mode-20261127T021623Z/,verify-scoped-lighting-mode-release-20261127T021715Z/,20261127T022056Z-{console.log,resources.csv,rendering-summary.json}. No assets/images published. AI-assisted verification/report: omp/OpenAI GPT-6 Astra.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.