GPU: stop advertising BC textures as render targets #3490

Open
andrewpozdnakov7-jpg wants to merge 2 commits from upstream-pr/3490 into main
andrewpozdnakov7-jpg commented 2026-11-27 09:08:34 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T09:08:34Z.


Refs #718.

The title-facing FORMAT_SUPPORT query advertises render-target use for BC textures. D3D12 disallows those render-target uses for the standard BC formats. The query now uses VIctory's existing block-size table to clear RENDER_TARGET, BLENDABLE and MULTISAMPLE_RENDERTARGET for BC1–BC7. The response stays independent of the host adapter. D3D12 format support

The regression calls the device method for all 21 standard BC variants, checks ordinary texture support, and includes RGBA8, a BGR format and two console-specific color formats as controls. It fails on 63bcca4 and passes with the fix. A separate native D3D12 query on Microsoft WARP agreed on the three render-target flags for all 21 BC variants and the RGBA8 control.

Windows diagnostics GPU suite: 244 passed, 3 failed and 1 ignored with the fix. Main had 243 passed, the same three failures and one ignored on the same WARP runtime. Strict GPU Clippy passed with default and all features. Asset policy and git diff checks passed.

Thanks to @fuzeofficlal for the original BC1 report and the adapter comparisons. Validation covers synthetic Windows capability queries on the WARP software adapter. A title-side observation is still needed to establish which flags affect its rendering path. AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5524050339 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3490). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T09:08:34Z. --- Refs #718. The title-facing `FORMAT_SUPPORT` query advertises render-target use for BC textures. D3D12 disallows those render-target uses for the standard BC formats. The query now uses VIctory's existing block-size table to clear `RENDER_TARGET`, `BLENDABLE` and `MULTISAMPLE_RENDERTARGET` for BC1–BC7. The response stays independent of the host adapter. [D3D12 format support](https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/hardware-support-for-direct3d-12-0-formats) The regression calls the device method for all 21 standard BC variants, checks ordinary texture support, and includes RGBA8, a BGR format and two console-specific color formats as controls. It fails on `63bcca4` and passes with the fix. A separate native D3D12 query on Microsoft WARP agreed on the three render-target flags for all 21 BC variants and the RGBA8 control. Windows diagnostics GPU suite: 244 passed, 3 failed and 1 ignored with the fix. Main had 243 passed, the same three failures and one ignored on the same WARP runtime. Strict GPU Clippy passed with default and all features. Asset policy and git diff checks passed. Thanks to @fuzeofficlal for the original BC1 report and the adapter comparisons. Validation covers synthetic Windows capability queries on the WARP software adapter. A title-side observation is still needed to establish which flags affect its rendering path. AI-assisted with Codex.
AurumCarlos commented 2026-11-27 09:23:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by AurumCarlos on 2026-11-27T09:23:49Z.

Review: COMMENTED


This has the same evidence gap that closed #1369. Its triage asked for what the console reports, or what the title does with the answer (the call sites and which bits it tests), and said a comparison with the host's native query doesn't settle it; fuzeofficlal closed it for lacking that title evidence. The WARP comparison here is the same kind of evidence. If a title is seen querying a BC format and branching on RENDER_TARGET, quoting that call would address it.

  • The mask is still partial (device.rs:315). If the goal is to stop advertising uses D3D12 can't create for BC, BC formats still report TEXTURE1D (0x10), DEPTH_STENCIL (0x10000) and TYPED_UNORDERED_ACCESS_VIEW (0x2000000), and all of Support2's typed UAV load/store/atomic bits (0xffff). Either clear those too or say why only the output-merger bits matter.
  • The shortcut: note is removed, but every non-BC format still gets the fixed all-uses masks. Keeping it leaves the remaining shortcut findable.
<!-- greyfinch-sync:Marvisak/VIctory:review:6085987347 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3490#pullrequestreview-6085987347). Originally posted by [AurumCarlos](https://github.com/AurumCarlos) on 2026-11-27T09:23:49Z. **Review:** COMMENTED --- This has the same evidence gap that closed #1369. Its triage asked for what the console reports, or what the title does with the answer (the call sites and which bits it tests), and said a comparison with the host's native query doesn't settle it; fuzeofficlal closed it for lacking that title evidence. The WARP comparison here is the same kind of evidence. If a title is seen querying a BC format and branching on `RENDER_TARGET`, quoting that call would address it. - **The mask is still partial** (`device.rs:315`). If the goal is to stop advertising uses D3D12 can't create for BC, BC formats still report `TEXTURE1D` (`0x10`), `DEPTH_STENCIL` (`0x10000`) and `TYPED_UNORDERED_ACCESS_VIEW` (`0x2000000`), and all of `Support2`'s typed UAV load/store/atomic bits (`0xffff`). Either clear those too or say why only the output-merger bits matter. - The `shortcut:` note is removed, but every non-BC format still gets the fixed all-uses masks. Keeping it leaves the remaining shortcut findable.
cloph-dsp commented 2026-11-27 09:36:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T09:36:10Z.


Independent CPU-only verification of PR #3490 (head 2a1a858, merge base 63bcca4).

  • $env:CARGO_TARGET_DIR='D:\Victory-Contrib\target-3490-verify'; $env:CARGO_BUILD_JOBS='2'; cargo test --locked -p victory-gpu --lib -- device::tests::block_compressed_formats_are_not_render_targets --exact --test-threads=1 --quiet → 1 passed, 0 failed, 232 filtered, exit 0.
  • git grep -F block_compressed_formats_are_not_render_targets 63bcca4 -- crates/victory-gpu/src/device.rs → no hit (the test is new).
  • git diff --check 63bcca4 HEAD → clean.
  • Synthetic vtable only; no GPU device, no game data. Only pre-existing fetch_update deprecation warnings.

This confirms the targeted synthetic test passes on Windows/Rust 1.100.0/MSVC. It does not settle the substantive points in AurumCarlos's review (title evidence for the queried bits and the remaining BC capability bits); those still need the author/maintainer.

AI-assisted (Hy4 flash). GPU/driver: N/A for this CPU test. No game data.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7214874411 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3490#issuecomment-7214874411). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-27T09:36:10Z. --- Independent CPU-only verification of PR #3490 (head `2a1a858`, merge base `63bcca4`). - `$env:CARGO_TARGET_DIR='D:\Victory-Contrib\target-3490-verify'; $env:CARGO_BUILD_JOBS='2'; cargo test --locked -p victory-gpu --lib -- device::tests::block_compressed_formats_are_not_render_targets --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 232 filtered, exit 0. - `git grep -F block_compressed_formats_are_not_render_targets 63bcca4 -- crates/victory-gpu/src/device.rs` → no hit (the test is new). - `git diff --check 63bcca4 HEAD` → clean. - Synthetic vtable only; no GPU device, no game data. Only pre-existing `fetch_update` deprecation warnings. This confirms the targeted synthetic test passes on Windows/Rust 1.100.0/MSVC. It does **not** settle the substantive points in AurumCarlos's review (title evidence for the queried bits and the remaining BC capability bits); those still need the author/maintainer. AI-assisted (Hy4 flash). GPU/driver: N/A for this CPU test. No game data.
andrewpozdnakov7-jpg commented 2026-11-27 09:52:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T09:52:10Z.


Thanks, AurumCarlos. 7c932d0 restores the shortcut comment for the fixed capability masks. The focused device test still passes.

The scope is the render-target, blend and multisample-render-target flags for standard BC formats. A broader capability profile needs console evidence for those other uses. I clarified the PR description so the synthetic query comparison and the title-side question are both visible. A verified BC-format query followed by a branch on one of these flags would establish the effect in a title.

AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7215192654 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3490#issuecomment-7215192654). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T09:52:10Z. --- Thanks, AurumCarlos. 7c932d0 restores the shortcut comment for the fixed capability masks. The focused device test still passes. The scope is the render-target, blend and multisample-render-target flags for standard BC formats. A broader capability profile needs console evidence for those other uses. I clarified the PR description so the synthetic query comparison and the title-side question are both visible. A verified BC-format query followed by a branch on one of these flags would establish the effect in a title. AI-assisted with Codex.
futurepro62 commented 2026-11-27 19:05:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-27T19:05:21Z.


NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head 7c932d0 (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: block_compressed_formats_are_not_render_targets.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7226176480 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3490#issuecomment-7226176480). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-27T19:05:21Z. --- NVIDIA full-suite run, to go with the reports above by cloph-dsp, since none of them names a GPU run. Tested exact head `7c932d0` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **867 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `block_compressed_formats_are_not_render_targets`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
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/3490:upstream-pr/3490'
git switch 'upstream-pr/3490'

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/3490'
git switch 'upstream-pr/3490'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3490'
git switch 'upstream-pr/3490'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3490'
git switch 'main'
git merge --squash 'upstream-pr/3490'
git switch 'main'
git merge --ff-only 'upstream-pr/3490'
git switch 'main'
git merge 'upstream-pr/3490'
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!3490
No description provided.