Format support query advertises BC1 as a render target #718

Open
opened 2026-11-24 08:01:04 +00:00 by fuzeofficlal · 6 comments
fuzeofficlal commented 2026-11-24 08:01:04 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-24T08:01:04Z.


On 787f665, the guest CheckFeatureSupport(FORMAT_SUPPORT) returns the same all-capabilities masks for every format. The query reports RENDER_TARGET for DXGI_FORMAT_BC1_UNORM, while a direct native D3D12 query on the selected adapter clears that bit. This reproduces on RTX 5090 and WARP.

Reproduction

Query FORMAT_SUPPORT through the guest device for BC1 and RGBA8. Compare both returned support words with a native query on the same adapter. RGBA8 is the positive render-target control. The guest and native BC1 answers disagree on both adapters.

Source fix

Commit 7007f33 uses the existing guest-to-PC format mapping and the selected native device. It reports zero support for five guest formats with no host mapping, including 189–191 whose numeric IDs describe different native PC formats.

The synthetic check passes ten format cases on each adapter, including positive RGBA8, BC1, the three mapped depth formats and the five unmapped formats. It also checks that the input format ID is preserved and malformed queries still reject. The GPU diagnostics suite passes 45 tests with one benchmark ignored on each backend.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6577303993 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/718). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-24T08:01:04Z. --- On `787f665`, the guest `CheckFeatureSupport(FORMAT_SUPPORT)` returns the same all-capabilities masks for every format. The query reports `RENDER_TARGET` for `DXGI_FORMAT_BC1_UNORM`, while a direct native D3D12 query on the selected adapter clears that bit. This reproduces on RTX 5090 and WARP. ## Reproduction Query `FORMAT_SUPPORT` through the guest device for BC1 and RGBA8. Compare both returned support words with a native query on the same adapter. RGBA8 is the positive render-target control. The guest and native BC1 answers disagree on both adapters. ## Source fix [Commit `7007f33`](https://github.com/fuzeofficlal/VIctory/commit/7007f33cae6dfc5bc2db508055ab089b03957989) uses the existing guest-to-PC format mapping and the selected native device. It reports zero support for five guest formats with no host mapping, including 189–191 whose numeric IDs describe different native PC formats. The synthetic check passes ten format cases on each adapter, including positive RGBA8, BC1, the three mapped depth formats and the five unmapped formats. It also checks that the input format ID is preserved and malformed queries still reject. The GPU diagnostics suite passes 45 tests with one benchmark ignored on each backend.
fuzeofficlal commented 2026-11-24 09:06:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-24T08:15:31Z.


I checked the related MULTISAMPLE_QUALITY_LEVELS query at 2745589. On both RTX 5090 and WARP, the guest reported one quality level for BC1 at 4× and for tiled RGBA8 at 8×, while native D3D12 reported zero. Non-tiled RGBA8 at 8× still reported one. An ordinary 4× RGBA8 clear and resolve read back 16/16 expected pixels on each adapter.

Follow-up commit 29a7e94 forwards the mapped format, sample count and flags to D3D12 within the guest texture layout's existing 8× ceiling. Both adapters passed all 15 synthetic query cases and 50 diagnostics tests, with one benchmark ignored.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7125916315 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/718#issuecomment-7125916315). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-24T08:15:31Z. --- I checked the related `MULTISAMPLE_QUALITY_LEVELS` query at `2745589`. On both RTX 5090 and WARP, the guest reported one quality level for BC1 at 4× and for tiled RGBA8 at 8×, while native D3D12 reported zero. Non-tiled RGBA8 at 8× still reported one. An ordinary 4× RGBA8 clear and resolve read back 16/16 expected pixels on each adapter. [Follow-up commit `29a7e94`](https://github.com/fuzeofficlal/VIctory/commit/29a7e94c06298fc38f9efcd0c2a6b6b684d979f7) forwards the mapped format, sample count and flags to D3D12 within the guest texture layout's existing 8× ceiling. Both adapters passed all 15 synthetic query cases and 50 diagnostics tests, with one benchmark ignored.
LAKSHYA-cmd-tech commented 2026-11-24 09:06:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by LAKSHYA-cmd-tech on 2026-11-24T08:34:32Z.


Verified on Windows 11 MSVC (Rust 1.98.1):
Querying native format support via host.device.CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT) with mapped resource::pc_format correctly reports hardware capabilities and zeroes unmapped formats (116, 117, 189..=191).

For BC1_UNORM (71), D3D12_FORMAT_SUPPORT1_RENDER_TARGET (0x4000) is now properly cleared (support word 0x9013e0 instead of 0x7fff_ffff).

Verification results:

  • All 50 tests in victory-gpu passed cleanly, including unit test format_support_reports_native_capabilities_or_fallback.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings passed with zero warnings.
  • cargo xtask policy verified (152 files ok).

Branch:
https://github.com/LAKSHYA-cmd-tech/VIctory/tree/fix/gpu-format-support-query

<!-- greyfinch-sync:Marvisak/VIctory:comment:7126301252 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/718#issuecomment-7126301252). Originally posted by [LAKSHYA-cmd-tech](https://github.com/LAKSHYA-cmd-tech) on 2026-11-24T08:34:32Z. --- Verified on Windows 11 MSVC (Rust 1.98.1): Querying native format support via `host.device.CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT)` with mapped `resource::pc_format` correctly reports hardware capabilities and zeroes unmapped formats (116, 117, 189..=191). For BC1_UNORM (71), `D3D12_FORMAT_SUPPORT1_RENDER_TARGET` (`0x4000`) is now properly cleared (support word `0x9013e0` instead of `0x7fff_ffff`). Verification results: - All 50 tests in `victory-gpu` passed cleanly, including unit test `format_support_reports_native_capabilities_or_fallback`. - `cargo clippy -p victory-gpu --all-targets -- -D warnings` passed with zero warnings. - `cargo xtask policy` verified (152 files ok). Branch: https://github.com/LAKSHYA-cmd-tech/VIctory/tree/fix/gpu-format-support-query
Super-cod commented 2026-11-24 16:05:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Super-cod on 2026-11-24T15:24:47Z.


I have implemented and verified a fix for this issue:

Summary of Changes

  1. In \crates/victory-gpu/src/device.rs, \FORMAT_SUPPORT\ queries the native host device via \host.device.CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, ...).
  2. Format mappings are translated via
    esource::pc_format(q[0]), and unmapped console formats (116, 117, 189..=191) zero out \Support1\ and \Support2\ to prevent invalid view creation on the host.
  3. Fallback to permissive support flags is preserved when running without a host D3D12 device.
  4. Added unit test \ ormat_support_queries_host_or_fallback\ covering RGBA8, BC1 (verifying \D3D12_FORMAT_SUPPORT1_RENDER_TARGET\ is not advertised), unmapped formats, and parameter validation.
  5. All 51 GPU unit tests, clippy, \cargo run -p xtask -- policy\ (154 files ok), and rustfmt pass cleanly.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7135982940 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/718#issuecomment-7135982940). Originally posted by [Super-cod](https://github.com/Super-cod) on 2026-11-24T15:24:47Z. --- I have implemented and verified a fix for this issue: - **Commit**: 7a14e4c - **Pull Request**: https://github.com/Super-cod/VIctory/pull/2 - **Compare with main**: https://github.com/Marvisak/VIctory/compare/main...Super-cod:VIctory:fix/format-support-native-query?expand=1 ### Summary of Changes 1. In \crates/victory-gpu/src/device.rs\, \FORMAT_SUPPORT\ queries the native host device via \host.device.CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, ...)\. 2. Format mappings are translated via \ esource::pc_format(q[0])\, and unmapped console formats (116, 117, 189..=191) zero out \Support1\ and \Support2\ to prevent invalid view creation on the host. 3. Fallback to permissive support flags is preserved when running without a host D3D12 device. 4. Added unit test \ ormat_support_queries_host_or_fallback\ covering RGBA8, BC1 (verifying \D3D12_FORMAT_SUPPORT1_RENDER_TARGET\ is not advertised), unmapped formats, and parameter validation. 5. All 51 GPU unit tests, clippy, \cargo run -p xtask -- policy\ (154 files ok), and rustfmt pass cleanly.
Marvisak commented 2026-11-25 02:06:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:47:21Z.


Automated triage for the maintainers.

Confirmed on current main. In crates/victory-gpu/src/device.rs, check_feature_support answers FORMAT_SUPPORT with fixed masks (0x7fff_ffff / 0xffff) for every format. Its own shortcut: comment says it should answer from the host device. So BC1 and the formats with no host mapping are reported as render targets. The MULTISAMPLE branch next to it (the follow-up comment) also reports one quality level for sample counts 1, 2, 4 and 8 whatever the format.

The fix is in an open pull request: #1369 by the reporter, which forwards both queries to the host device through resource::pc_format. It's labelled as needing a rebase onto current main. The fork branches in the comments carry the same change. Pull requests are open to everyone, so further work should go to #1369 or a new PR.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149957594 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/718#issuecomment-7149957594). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:47:21Z. --- <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-24T15:24:47Z at=2026-11-25T01:49:00Z --> Automated triage for the maintainers. Confirmed on current `main`. In `crates/victory-gpu/src/device.rs`, `check_feature_support` answers `FORMAT_SUPPORT` with fixed masks (`0x7fff_ffff` / `0xffff`) for every format. Its own `shortcut:` comment says it should answer from the host device. So BC1 and the formats with no host mapping are reported as render targets. The `MULTISAMPLE` branch next to it (the follow-up comment) also reports one quality level for sample counts 1, 2, 4 and 8 whatever the format. The fix is in an open pull request: #1369 by the reporter, which forwards both queries to the host device through `resource::pc_format`. It's labelled as needing a rebase onto current `main`. The fork branches in the comments carry the same change. Pull requests are open to everyone, so further work should go to #1369 or a new PR. --- _Generated by [Claude Code](https://claude.ai/code)_
andrewpozdnakov7-jpg commented 2026-11-27 09:08:56 +00:00 (Migrated from github.com)
Author
Contributor

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


#3490 is a focused fix for the BC render-target flags. The guest query uses VIctory's existing block-size table and clears the same three render-target flags for all standard BC formats on every adapter. The new device test fails on main and passes with the fix. Native WARP reports the same three flags for all 21 BC formats and the RGBA8 control.

The PR lists the full Windows comparison and the evidence needed for review. AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7214336098 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/718#issuecomment-7214336098). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T09:08:56Z. --- #3490 is a focused fix for the BC render-target flags. The guest query uses VIctory's existing block-size table and clears the same three render-target flags for all standard BC formats on every adapter. The new device test fails on main and passes with the fix. Native WARP reports the same three flags for all 21 BC formats and the RGBA8 control. The PR lists the full Windows comparison and the evidence needed for review. AI-assisted with Codex.
andrewpozdnakov7-jpg commented 2026-11-27 12:26:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T12:26:26Z.


#3517 covers the multisample-quality query discussed here. With 2356e25, all standard BC1–BC7 formats report one level at one sample and zero at 2, 4 and 8. The direct WARP check gave the same results in all 84 BC queries, and RGBA8 returned one level at each count. The two guest regression tests also passed with #3490 and #3517 applied together. This measures the device query with synthetic inputs. A game call-site observation is still open.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7218245012 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/718#issuecomment-7218245012). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T12:26:26Z. --- [#3517](https://github.com/Marvisak/VIctory/pull/3517) covers the multisample-quality query discussed here. With `2356e25`, all standard BC1–BC7 formats report one level at one sample and zero at 2, 4 and 8. The direct WARP check gave the same results in all 84 BC queries, and RGBA8 returned one level at each count. The two guest regression tests also passed with #3490 and #3517 applied together. This measures the device query with synthetic inputs. A game call-site observation is still open. AI-assisted with OpenAI Codex.
Sign in to join this conversation.
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#718
No description provided.