Format support query advertises BC1 as a render target #718

Open
opened 2026-11-26 04:13:52 +00:00 by github-bot · 4 comments
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 08:01 UTC · original

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.

**@⁠fuzeofficlal** on GitHub · 2026-11-24 08:01 UTC · [original](https://github.com/Marvisak/VIctory/issues/718) 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:52 +00:00
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-24 08:15 UTC · original

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.

**@⁠fuzeofficlal** on GitHub · 2026-11-24 08:15 UTC · [original](https://github.com/Marvisak/VIctory/issues/718#issuecomment-7125916315) 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.
Author
Owner

@⁠LAKSHYA-cmd-tech on GitHub · 2026-11-24 08:34 UTC · original

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

**@⁠LAKSHYA-cmd-tech** on GitHub · 2026-11-24 08:34 UTC · [original](https://github.com/Marvisak/VIctory/issues/718#issuecomment-7126301252) 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
Author
Owner

@⁠Super-cod on GitHub · 2026-11-24 15:24 UTC · original

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.
**@⁠Super-cod** on GitHub · 2026-11-24 15:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/718#issuecomment-7135982940) 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:47 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 01:47 UTC · [original](https://github.com/Marvisak/VIctory/issues/718#issuecomment-7149957594) <!-- 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)_
This discussion has been locked. Commenting is limited to contributors.
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#718
No description provided.