GPU: castable formats the host has #2101

Open
github-bot wants to merge 1 commit from github-bot/gh-2101 into main AGit
Owner

@⁠Deilach on GitHub · 2026-11-25 04:59 UTC · original
Deilach:linux-castable-formats → main · +71 −3 · 1 files · 1 commits · open

What

Under Wine and Proton, which run D3D12 on Vulkan through vkd3d-proton, the first castable colour texture logs:

WARN victory_gpu::resource: the host refuses castable formats: textures of one memory in other formats get their own host texture error=Invalid parameter. (0x80070057) desc=ResourceDesc { … width: 3840, height: 2160, … format: 28, … flags: 5 }

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 formats castable(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_texture keeps only the castable formats the host reports support for: CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT) with a non-zero Support1, 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

  • New: resource::tests::a_colour_target_is_castable_to_the_formats_the_host_has. A 256×256 R8G8B8A8_UNORM render target with unordered access is made castable to the formats of its element that the host has. Under vkd3d-proton it fails on main, with the warning above, and passes with this change.
  • An existing test that failed under vkd3d-proton now passes: 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:

main this change
"refuses castable formats" warning yes none
copies between textures of one memory 59–166 per frame 0
host textures replaced 49 0
saved by title textures sharing one host texture ~130 MB ~308 MB
host texture memory ~9.2 GB ~8.7 GB

victory-gpu tests on Linux, Wine 11.22 + vkd3d-proton master on RADV, RX 9070 XT: main 130 ok / 12 failed, this branch 131 ok / 12 failed. The differences are the two tests above, plus draw::tests::a_depth_texture_written_through_unordered_views_reads_as_depth, which fails on main here too when run alone (5 of 5). cargo clippy --workspace --all-targets [--all-features] -- -D warnings is clean.

🤖 Generated with Claude Code

**@⁠Deilach** on GitHub · 2026-11-25 04:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101) `Deilach:linux-castable-formats` → `main` · +71 −3 · 1 files · 1 commits · open ## What Under Wine and Proton, which run D3D12 on Vulkan through vkd3d-proton, the first castable colour texture logs: ``` WARN victory_gpu::resource: the host refuses castable formats: textures of one memory in other formats get their own host texture error=Invalid parameter. (0x80070057) desc=ResourceDesc { … width: 3840, height: 2160, … format: 28, … flags: 5 } ``` 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 formats `castable(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_texture` keeps only the castable formats the host reports support for: `CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT)` with a non-zero `Support1`, 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 - New: `resource::tests::a_colour_target_is_castable_to_the_formats_the_host_has`. A 256×256 `R8G8B8A8_UNORM` render target with unordered access is made castable to the formats of its element that the host has. Under vkd3d-proton it fails on `main`, with the warning above, and passes with this change. - An existing test that failed under vkd3d-proton now passes: `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: | | `main` | this change | |---|---|---| | "refuses castable formats" warning | yes | none | | copies between textures of one memory | 59–166 per frame | 0 | | host textures replaced | 49 | 0 | | saved by title textures sharing one host texture | ~130 MB | ~308 MB | | host texture memory | ~9.2 GB | ~8.7 GB | `victory-gpu` tests on Linux, Wine 11.22 + vkd3d-proton master on RADV, RX 9070 XT: `main` 130 ok / 12 failed, this branch 131 ok / 12 failed. The differences are the two tests above, plus `draw::tests::a_depth_texture_written_through_unordered_views_reads_as_depth`, which fails on `main` here too when run alone (5 of 5). `cargo clippy --workspace --all-targets [--all-features] -- -D warnings` is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:54:48 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-25 05:05 UTC · original

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 new a_colour_target_is_castable_to_the_formats_the_host_has passes. The 2 failures are #1744's heap-cap failures on main. Same as main on this hardware (native D3D12, so not the vkd3d-proton case this PR is about).

AI-assisted (Claude Code).

**@⁠upipibi** on GitHub · 2026-11-25 05:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7153441040) 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 new `a_colour_target_is_castable_to_the_formats_the_host_has` passes. The 2 failures are #1744's heap-cap failures on `main`. Same as `main` on this hardware (native D3D12, so not the vkd3d-proton case this PR is about). AI-assisted (Claude Code).
Author
Owner

@⁠fiestorra on GitHub · 2026-11-25 05:46 UTC · original

Reviewed the Support1 != 0 choice by measuring it: it is the right one, and here is the trap it walks past

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 32.0.16.2124), for the 21 formats castable(28) lists:

test formats kept
Support1 != D3D12_FORMAT_SUPPORT1_NONE (what this PR uses) 21 of 21
Support1 & CAST_WITHIN_BIT_LAYOUT (0x8000) 13 of 21

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

25, 30, 32, 36, 38, 42, 43, 89   (s1 = 0x27051f3, 0x27051f3, 0x27051f3,
                                  0x27051f3, 0x27051f3, 0x27051ff,
                                  0x27051fb, 0x31180020)

which is exactly the trap: CAST_WITHIN_BIT_LAYOUT is 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 of castable(28) do not carry CAST_WITHIN_BIT_LAYOUT and 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:

  • the 128-entry table is safe: castable() iterates 1..=115, so the HAS.get(format as usize) fallback to false cannot be reached by a format from this path. (I looked, because a fixed table with a silent false outside its range is the kind of thing that bites later.)
  • it does not collide with the other change in this file: merging this onto my #1832 (which also asks CheckFeatureSupport for 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 EnhancedBarriersSupportedFormats list), 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.

**@⁠fiestorra** on GitHub · 2026-11-25 05:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7154126747) **Reviewed the `Support1 != 0` choice by measuring it: it is the right one, and here is the trap it walks past** 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 `32.0.16.2124`), for the 21 formats `castable(28)` lists:** | test | formats kept | |---|---| | `Support1 != D3D12_FORMAT_SUPPORT1_NONE` (what this PR uses) | **21 of 21** | | `Support1 & CAST_WITHIN_BIT_LAYOUT` (`0x8000`) | **13 of 21** | 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 ``` 25, 30, 32, 36, 38, 42, 43, 89 (s1 = 0x27051f3, 0x27051f3, 0x27051f3, 0x27051f3, 0x27051f3, 0x27051ff, 0x27051fb, 0x31180020) ``` which is exactly the trap: `CAST_WITHIN_BIT_LAYOUT` is 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 of `castable(28)` do not carry `CAST_WITHIN_BIT_LAYOUT` and 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: - **the 128-entry table is safe**: `castable()` iterates `1..=115`, so the `HAS.get(format as usize)` fallback to `false` cannot be reached by a format from this path. (I looked, because a fixed table with a silent `false` outside its range is the kind of thing that bites later.) - **it does not collide with the other change in this file**: merging this onto my #1832 (which also asks `CheckFeatureSupport` for 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 `EnhancedBarriersSupportedFormats` list), 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 10:38 UTC · original

Automated triage for the maintainers.

In resource.rs, make_texture now passes only the castable formats the host reports. host_has asks CheckFeatureSupport(FORMAT_SUPPORT) with Support1 != NONE and caches the answer per format. Before, one unknown format (89 on vkd3d-proton) made the host refuse the whole list. takes already reads t.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 covers castable's 1..=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

**@⁠Marvisak** on GitHub · 2026-11-25 10:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7159976742) <!-- victory-triage v1 head=4d8c89a86ac968d9e7687bec6fafcd0b9eef2405 verdict=merge-candidate at=2026-11-25T10:38:25Z --> Automated triage for the maintainers. In `resource.rs`, `make_texture` now passes only the castable formats the host reports. `host_has` asks `CheckFeatureSupport(FORMAT_SUPPORT)` with `Support1 != NONE` and caches the answer per format. Before, one unknown format (89 on vkd3d-proton) made the host refuse the whole list. `takes` already reads `t.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 covers `castable`'s `1..=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](https://claude.ai/code)_
Author
Owner

@⁠0xKaji on GitHub · 2026-11-25 19:40 UTC · original

Tested on Linux + Wine 11.22 + vkd3d-proton + NVIDIA RTX 3060 in Series S mode:

  • Texture sharing started working partially (title textures sharing one 5).
  • However, CreateCommittedResource3 still fails with E_INVALIDARG (0x80070057) on 3840x2160 format 28 flags 5 (the host refuses castable formats). Under vkd3d-proton, some format in castable(28) likely reports TEXTURE2D support while lacking RENDER_TARGET | UNORDERED_ACCESS support when flags & 5 is requested.
**@⁠0xKaji** on GitHub · 2026-11-25 19:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7172614601) Tested on Linux + Wine 11.22 + vkd3d-proton + NVIDIA RTX 3060 in Series S mode: - Texture sharing started working partially (`title textures sharing one 5`). - However, `CreateCommittedResource3` still fails with `E_INVALIDARG (0x80070057)` on `3840x2160 format 28 flags 5` (`the host refuses castable formats`). Under `vkd3d-proton`, some format in `castable(28)` likely reports `TEXTURE2D` support while lacking `RENDER_TARGET | UNORDERED_ACCESS` support when `flags & 5` is requested.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 19:54 UTC · original

Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of 4d8c89a8 (on 13f91ca):

Verification (rustc 1.98.1 MSVC)

  • cargo xtask policy: 184 files ok; cargo clippy --locked -p victory-gpu --all-targets (default & --features diagnostics): 0 warnings.
  • WARP (VICTORY_D3D12_WARP=1, --features diagnostics --test-threads=1): 199 passed, 0 failed, 1 ignored (including a_colour_target_is_castable_to_the_formats_the_host_has).
  • RTX 5090: resource::tests 18 passed, 0 failed (including a_colour_target_is_castable_to_the_formats_the_host_has); draw::tests 11 passed.
  • Merge compatibility: clean zero-conflict 3-way git merge-tree with #1406, #2462, and #2679.

Review Notes

  • Fixed-size [AtomicU8; 128] cache (host_has) is bounds-safe over 1..=115 and thread-safe for the singleton host device, while keeping Windows castable formats intact (Support1 != NONE avoids dropping formats that Windows drivers accept for casting).
  • Cleanly complementary to #2462 / #2679 (typed UAV store checks on the view side). Ready to merge.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 19:54 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7172920243) Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of `4d8c89a8` (on `13f91ca`): ### Verification (`rustc 1.98.1` MSVC) - `cargo xtask policy`: **184 files ok**; `cargo clippy --locked -p victory-gpu --all-targets` (default & `--features diagnostics`): **0 warnings**. - **WARP (`VICTORY_D3D12_WARP=1`, `--features diagnostics --test-threads=1`):** **199 passed, 0 failed, 1 ignored** (including `a_colour_target_is_castable_to_the_formats_the_host_has`). - **RTX 5090:** `resource::tests` **18 passed, 0 failed** (including `a_colour_target_is_castable_to_the_formats_the_host_has`); `draw::tests` **11 passed**. - **Merge compatibility:** clean zero-conflict 3-way `git merge-tree` with **#1406**, **#2462**, and **#2679**. ### Review Notes - Fixed-size `[AtomicU8; 128]` cache (`host_has`) is bounds-safe over `1..=115` and thread-safe for the singleton host device, while keeping Windows castable formats intact (`Support1 != NONE` avoids dropping formats that Windows drivers accept for casting). - Cleanly complementary to #2462 / #2679 (typed UAV store checks on the view side). Ready to merge.
Author
Owner

@⁠Kajanos on GitHub · 2026-11-25 20:43 UTC · original

NVIDIA + vkd3d-proton unit-test run, head 4d8c89a86a merged onto main 13f91caee2.

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.

  • On main, draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view fails here (round 0: a placed texture). With this PR it passes in every run.
  • I ran the full victory-gpu suite 5 times: 191–192 passed. The remaining failures all also fail on main in this environment:
    • descriptor::host::…dynamic_slots_are_held_until_released and memory::…lists_share_a_table_and_copies_keep_their_views (the vkd3d-proton heap is smaller than HEAP_VIEWS)
    • the two pipeline::library tests (fixed by #1722)
  • In 1 of the 5 runs, shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changed also 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)

**@⁠Kajanos** on GitHub · 2026-11-25 20:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7174098481) **NVIDIA + vkd3d-proton unit-test run**, head `4d8c89a86a` merged onto `main` `13f91caee2`. 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`. - On `main`, `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view` fails here (`round 0: a placed texture`). With this PR it passes in every run. - I ran the full `victory-gpu` suite 5 times: 191–192 passed. The remaining failures all also fail on `main` in this environment: - `descriptor::host::…dynamic_slots_are_held_until_released` and `memory::…lists_share_a_table_and_copies_keep_their_views` (the vkd3d-proton heap is smaller than `HEAP_VIEWS`) - the two `pipeline::library` tests (fixed by #1722) - In 1 of the 5 runs, `shadow::tests::marked_pages_go_back_by_the_bytes_the_gpu_changed` also 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)
Author
Owner

@⁠arogan178 on GitHub · 2026-11-25 23:42 UTC · original

Note

🤖 Claude Opus 5.5 responding on behalf of @⁠arogan178

Verified on RDNA 4 under Proton: draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view fails on main ("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_47 10.0.26100. victory-gpu lib tests cross-built for x86_64-pc-windows-msvc from main at 63bcca4 merged with #1722 and #2101 (both merge cleanly): 232 passed, 0 failed. main alone: 228 passed, 3 failed, the three named in these two PRs.

**@⁠arogan178** on GitHub · 2026-11-25 23:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7177933747) > [!NOTE] > 🤖 **Claude Opus 5.5 responding on behalf of @⁠arogan178** Verified on RDNA 4 under Proton: `draw::tests::a_texture_written_in_one_format_reads_in_another_through_a_placed_view` fails on `main` ("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_47` 10.0.26100. `victory-gpu` lib tests cross-built for `x86_64-pc-windows-msvc` from `main` at `63bcca4` merged with #1722 and #2101 (both merge cleanly): 232 passed, 0 failed. `main` alone: 228 passed, 3 failed, the three named in these two PRs.
Author
Owner

@⁠neonbyte1 on GitHub · 2026-11-26 01:52 UTC · original

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 is main 219878a plus #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: 51 no host texture … format: 67 … flags: 4 per 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.

Same build, gameplay frame 1500 without #2101 with #2101
no host texture lines (format 67) 53 (51) 0
refuses castable formats 1 0
presented pixels above 15/255 1.2 % 83 %

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.

**@⁠neonbyte1** on GitHub · 2026-11-26 01:52 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7180232610) 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 is `main` 219878a plus #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: 51 `no host texture … format: 67 … flags: 4` per 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. | Same build, gameplay frame 1500 | without #2101 | with #2101 | |---|---|---| | `no host texture` lines (format 67) | 53 (51) | 0 | | `refuses castable formats` | 1 | 0 | | presented pixels above 15/255 | 1.2 % | 83 % | 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._
Author
Owner

@⁠catminou4 on GitHub · 2026-11-25 05:02 UTC · original · reviewed

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).

**@⁠catminou4** on GitHub · 2026-11-25 05:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101#pullrequestreview-6052105399) · **reviewed** 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).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 13:09 UTC · original · approved these changes

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-tree against origin/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 (including a_colour_target_is_castable_to_the_formats_the_host_has and a_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_NONE keeps 21/21 on both RTX 5090 and WARP; requiring CAST_WITHIN_BIT_LAYOUT would drop 26 (R11G11B10_FLOAT) and 67 (R9G9B9E5_SHAREDEXP) (19/21).
    • castable(67): Support1 != NONE keeps 21/21 on both adapters vs 20/21 (26 dropped) with CAST_WITHIN_BIT_LAYOUT.

Review Notes

  • host_has (crates/victory-gpu/src/resource.rs:1172-1201) uses a lock-free [AtomicU8; 128] cache covering castable()'s entire 1..=115 range cleanly, and filtering via castable_formats.retain(|&f| host_has(host, f)) (:1228) preserves all native Windows castable lists while preventing a single unsupported format from failing CreateCommittedResource3 whole.
  • Minor non-blocking notes:
    • a_colour_target_is_castable_to_the_formats_the_host_has (crates/victory-gpu/src/resource.rs:1897-1922) assumes ID3D12Device10 is present (t.castable is empty on Windows 10 without Agility SDK).
    • If merged alongside #2389, #2389 adds a 4th on_demand: bool parameter to make_texture, so line 1915 in the new test will need , false.

Looks good to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 13:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/2101#pullrequestreview-6074678800) · **approved these changes** 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-tree` against `origin/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** (including `a_colour_target_is_castable_to_the_formats_the_host_has` and `a_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_NONE` keeps **21/21** on both RTX 5090 and WARP; requiring `CAST_WITHIN_BIT_LAYOUT` would drop **`26` (`R11G11B10_FLOAT`) and `67` (`R9G9B9E5_SHAREDEXP`)** (`19/21`). - `castable(67)`: `Support1 != NONE` keeps **21/21** on both adapters vs `20/21` (`26` dropped) with `CAST_WITHIN_BIT_LAYOUT`. ### Review Notes - `host_has` (`crates/victory-gpu/src/resource.rs:1172-1201`) uses a lock-free `[AtomicU8; 128]` cache covering `castable()`'s entire `1..=115` range cleanly, and filtering via `castable_formats.retain(|&f| host_has(host, f))` (`:1228`) preserves all native Windows castable lists while preventing a single unsupported format from failing `CreateCommittedResource3` whole. - Minor non-blocking notes: - `a_colour_target_is_castable_to_the_formats_the_host_has` (`crates/victory-gpu/src/resource.rs:1897-1922`) assumes `ID3D12Device10` is present (`t.castable` is empty on Windows 10 without Agility SDK). - If merged alongside `#2389`, `#2389` adds a 4th `on_demand: bool` parameter to `make_texture`, so line 1915 in the new test will need `, false`. Looks good to merge.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2101/head:github-bot/gh-2101'
git switch 'github-bot/gh-2101'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2101'
git switch 'github-bot/gh-2101'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2101'
git switch 'github-bot/gh-2101'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2101'
git switch 'main'
git merge --squash 'github-bot/gh-2101'
git switch 'main'
git merge --ff-only 'github-bot/gh-2101'
git switch 'main'
git merge 'github-bot/gh-2101'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2101
No description provided.