GPU: castable formats the host has #2099

Open
Deilach wants to merge 1 commit from upstream-pr/2101 into main
Deilach commented 2026-11-25 04:59:18 +00:00 (Migrated from github.com)

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:

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

<!-- greyfinch-sync:Marvisak/VIctory:issue:5485461029 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101). Originally posted by [Deilach](https://github.com/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: ``` 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)
catminou4 commented 2026-11-25 05:02:23 +00:00 (Migrated from github.com)

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

<!-- greyfinch-sync:Marvisak/VIctory:review:6052105399 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#pullrequestreview-6052105399). Originally posted by [catminou4](https://github.com/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).
upipibi commented 2026-11-25 05:06:28 +00:00 (Migrated from github.com)

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7153441040 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7153441040). Originally posted by [upipibi](https://github.com/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 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).
fiestorra commented 2026-11-25 06:02:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fiestorra on 2026-11-25T05:46:32Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7154126747 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7154126747). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-11-25T05:46:32Z. --- **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.
Marvisak commented 2026-11-25 11:05:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:38:38Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7159976742 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7159976742). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T10:38:38Z. --- <!-- 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)_
0xKaji commented 2026-11-25 20:06:21 +00:00 (Migrated from github.com)

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:

  • 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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7172614601 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7172614601). Originally posted by [0xKaji](https://github.com/0xKaji) on 2026-11-25T19:40:20Z. --- 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.
fuzeofficlal commented 2026-11-25 20:06:25 +00:00 (Migrated from github.com)

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 (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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7172920243 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7172920243). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T19:54:10Z. --- 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.
Kajanos commented 2026-11-25 21:03:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Kajanos on 2026-11-25T20:43:29Z.


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)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7174098481 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7174098481). Originally posted by [Kajanos](https://github.com/Kajanos) on 2026-11-25T20:43:29Z. --- **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)
arogan178 commented 2026-11-26 00:03:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by arogan178 on 2026-11-25T23:42:18Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7177933747 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7177933747). Originally posted by [arogan178](https://github.com/arogan178) on 2026-11-25T23:42:18Z. --- > [!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.
neonbyte1 commented 2026-11-26 02:07:15 +00:00 (Migrated from github.com)

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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7180232610 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7180232610). Originally posted by [neonbyte1](https://github.com/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 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._
fuzeofficlal commented 2026-11-26 13:09:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T13:09:27Z.

Review: APPROVED


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.

<!-- greyfinch-sync:Marvisak/VIctory:review:6074678800 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#pullrequestreview-6074678800). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T13:09:27Z. **Review:** APPROVED --- 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.
AIcelos commented 2026-11-26 21:37:20 +00:00 (Migrated from github.com)

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

  • Cross-build from Linux: cargo xwin build --profile diag -p victory --features diagnostics --target x86_64-pc-windows-msvc
  • Wine 10 prefix + vkd3d-proton d3d12.dll/d3d12core.dll and DXVK dxgi.dll from GE-Proton 11-14 copied to system32/, WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n,builtin"
  • Do NOT copy dxil.dll: Wine's built-in (Wine-mono) DXBC builder works; NVIDIA's Windows dxil.dll cannot load under Wine and blocks vkd3d-proton. (The team gist "remove all D3D12/DXGI/DXIL + builtin override" fails on stock wine — wine 10 ships no d3d12.dll of its own.)
  • Fixes in this branch that made it work: versioned dxcompiler_NN.dll fallback (Wine's is unversioned), IDxcContainerBuilder v1→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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7203902661 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7203902661). Originally posted by [AIcelos](https://github.com/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`): - Cross-build from Linux: `cargo xwin build --profile diag -p victory --features diagnostics --target x86_64-pc-windows-msvc` - Wine 10 prefix + vkd3d-proton `d3d12.dll`/`d3d12core.dll` and DXVK `dxgi.dll` from GE-Proton 11-14 copied to `system32/`, `WINEDLLOVERRIDES="d3d12,d3d12core,dxgi=n,builtin"` - **Do NOT copy `dxil.dll`**: Wine's built-in (Wine-mono) DXBC builder works; NVIDIA's Windows `dxil.dll` cannot load under Wine and blocks vkd3d-proton. (The team gist "remove all D3D12/DXGI/DXIL + builtin override" fails on stock wine — wine 10 ships no `d3d12.dll` of its own.) - Fixes in this branch that made it work: versioned `dxcompiler_NN.dll` fallback (Wine's is unversioned), `IDxcContainerBuilder` v1→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.
Dukestar69 commented 2026-11-26 22:50:30 +00:00 (Migrated from github.com)

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

  • Filtering castable formats to those supported by the host device cleanly avoids creating resources with unsupported castable formats.
  • cargo test -p victory-gpu --lib resource:: -- --test-threads=1: 19 passed, 0 failed (including a_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).

<!-- greyfinch-sync:Marvisak/VIctory:review:6081256154 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#pullrequestreview-6081256154). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-11-26T22:50:30Z. **Review:** APPROVED --- LGTM — verified on RTX 5090 (Windows / D3D12) against `origin/main` (`63bcca4`). - Filtering castable formats to those supported by the host device cleanly avoids creating resources with unsupported castable formats. - `cargo test -p victory-gpu --lib resource:: -- --test-threads=1`: 19 passed, 0 failed (including `a_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).
pickles976 commented 2026-11-27 01:24:41 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pickles976 on 2026-11-27T01:24:41Z.


Matched Wine/RTX4060 confirmation of this capability filter: #3147 2eb38bb1185f1b1b077da398b8e435787c0c6356 fails its new same-list R32_UINT-write/RGB9E5-sample fixture before dispatch; the same checkout with only this PR’s 4d8c89a86ac968d9e7687bec6fafcd0b9eef2405 host_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_srv fixture onto our dirty VIctory-pr2945-fixed (base 3ed7d725, scoped #2519 backing/copy-only alias fixes, #2121 paging + fork stride fix, #189 lowering). Production contains only this PR's 4d8c89a8 castable-format capability filter, not #3147's broader production stack. The older Slots API required calling the existing descriptor::host::make_view for 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 #1701 fb27a56d mode 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, four E_FAIL). The native log has NVVM compiler failures; graphics creation returns Vulkan -13 (VK_ERROR_UNKNOWN), which this vkd3d graphics path collapses to E_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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7207265429 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2101#issuecomment-7207265429). Originally posted by [pickles976](https://github.com/pickles976) on 2026-11-27T01:24:41Z. --- Matched Wine/RTX4060 confirmation of this capability filter: #3147 `2eb38bb1185f1b1b077da398b8e435787c0c6356` fails its new same-list R32_UINT-write/RGB9E5-sample fixture before dispatch; the same checkout with only this PR’s `4d8c89a86ac968d9e7687bec6fafcd0b9eef2405` host_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_srv` fixture onto our dirty `VIctory-pr2945-fixed` (base `3ed7d725`, scoped #2519 backing/copy-only alias fixes, #2121 paging + fork stride fix, #189 lowering). Production contains only this PR's `4d8c89a8` castable-format capability filter, not #3147's broader production stack. The older Slots API required calling the existing `descriptor::host::make_view` for 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 #1701 `fb27a56d` mode 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`, four `E_FAIL`). The native log has NVVM compiler failures; graphics creation returns Vulkan `-13` (`VK_ERROR_UNKNOWN`), which this vkd3d graphics path collapses to `E_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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2101:upstream-pr/2101'
git switch 'upstream-pr/2101'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/2101'
git switch 'upstream-pr/2101'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2101'
git switch 'upstream-pr/2101'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2101'
git switch 'main'
git merge --squash 'upstream-pr/2101'
git switch 'main'
git merge --ff-only 'upstream-pr/2101'
git switch 'main'
git merge 'upstream-pr/2101'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!2099
No description provided.