GPU: query native format support and multisample quality levels #1369

Closed
fuzeofficlal wants to merge 1 commit from upstream-pr/1369 into main
fuzeofficlal commented 2026-11-24 17:38:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-24T17:38:24Z.


Fixes #718.

Summary

  • Forward D3D12_FEATURE_FORMAT_SUPPORT and D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS (SampleCount in 1 | 2 | 4 | 8) in check_feature_support to the host ID3D12Device::CheckFeatureSupport through resource::pc_format.
  • Zero out support bits / quality levels (S_OK) for console-only formats without a host mapping (116, 117, 189..=191) instead of reporting every format as universally renderable and multisample-capable, while preserving input fields and propagating host HRESULT errors.

Verification

  • Added unit and host-comparison tests across 22 formats (including BC1, depth/stencil 118..=120 -> 45..=47, unmapped console formats, and sample counts 1/2/4/8):
    • NVIDIA GeForce RTX 5090 (VICTORY_D3D12_DEBUG=1): passed (0 debug errors)
    • Microsoft D3D12 WARP (VICTORY_D3D12_DEBUG=1): passed (0 debug errors)
  • cargo clippy --workspace --all-targets --all-features and cargo xtask policy: passed.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6587788888 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1369). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-24T17:38:24Z. --- Fixes #718. ### Summary - Forward `D3D12_FEATURE_FORMAT_SUPPORT` and `D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS` (`SampleCount` in `1 | 2 | 4 | 8`) in `check_feature_support` to the host `ID3D12Device::CheckFeatureSupport` through `resource::pc_format`. - Zero out support bits / quality levels (`S_OK`) for console-only formats without a host mapping (`116`, `117`, `189..=191`) instead of reporting every format as universally renderable and multisample-capable, while preserving input fields and propagating host `HRESULT` errors. ### Verification - Added unit and host-comparison tests across 22 formats (including `BC1`, depth/stencil `118..=120 -> 45..=47`, unmapped console formats, and sample counts `1/2/4/8`): - **NVIDIA GeForce RTX 5090** (`VICTORY_D3D12_DEBUG=1`): passed (`0` debug errors) - **Microsoft D3D12 WARP** (`VICTORY_D3D12_DEBUG=1`): passed (`0` debug errors) - `cargo clippy --workspace --all-targets --all-features` and `cargo xtask policy`: passed.
catminou4 commented 2026-11-24 21:02:17 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T20:49:18Z.

Review: COMMENTED


Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; this is source review plus the PR's own Windows tests.

CheckFeatureSupport FORMAT_SUPPORT and MULTISAMPLE now query the real host D3D12 device instead of blanket answers (0x7fff_ffff / 1 quality level), with console-only formats (116, 117, 189..=191 — whose numeric PC IDs mean other formats) zeroed via host_format(), and the old fallbacks kept when no host device exists. Tests cover arg validation, unmapped formats, and host-matching support bits (host-gated). This makes titles that probe format support get truthful answers.

<!-- greyfinch-sync:Marvisak/VIctory:review:6047163412 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1369#pullrequestreview-6047163412). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T20:49:18Z. **Review:** COMMENTED --- Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows_sys/Win32) — nothing compiles or runs on macOS; this is source review plus the PR's own Windows tests. CheckFeatureSupport FORMAT_SUPPORT and MULTISAMPLE now query the real host D3D12 device instead of blanket answers (0x7fff_ffff / 1 quality level), with console-only formats (116, 117, 189..=191 — whose numeric PC IDs mean other formats) zeroed via host_format(), and the old fallbacks kept when no host device exists. Tests cover arg validation, unmapped formats, and host-matching support bits (host-gated). This makes titles that probe format support get truthful answers.
Marvisak commented 2026-11-25 02:05:59 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Needs work. It now merges cleanly with main. device.rs::check_feature_support now answers the title's FORMAT_SUPPORT and MULTISAMPLE queries with the host adapter's capabilities, and it reports zero support for 116, 117 and 189 to 191. That changes runtime return values the title sees, and the evidence given is a comparison with the host's own CheckFeatureSupport, which shows the code forwards correctly but not that the title should see the PC answer. Two concrete concerns:

  • 116, 117 and 189 to 191 are formats the console has: resource.rs on main documents them and gives them element sizes. Telling the title they have no support at all could steer it away from paths it uses on the console, or make it fail.
  • The host's support masks and quality-level counts differ by adapter, so the title would see different answers on different PCs.

What would change the verdict: evidence of what the console reports for these queries, or of what the title does with the answer (the call sites and which bits it tests), plus an answer for the console-only formats that matches what VIctory can actually create for them, rather than zero.

CI: passing (check).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149511303 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1369#issuecomment-7149511303). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T01:24:21Z. --- <!-- victory-triage v1 head=5d49f5c8d32fbc50f8b7bb3d208f82712c5ae0dd verdict=needs-work at=2026-11-25T06:28:00Z --> Automated triage for the maintainers. **Needs work.** It now merges cleanly with `main`. `device.rs::check_feature_support` now answers the title's `FORMAT_SUPPORT` and `MULTISAMPLE` queries with the host adapter's capabilities, and it reports zero support for 116, 117 and 189 to 191. That changes runtime return values the title sees, and the evidence given is a comparison with the host's own `CheckFeatureSupport`, which shows the code forwards correctly but not that the title should see the PC answer. Two concrete concerns: - 116, 117 and 189 to 191 are formats the console has: `resource.rs` on main documents them and gives them element sizes. Telling the title they have no support at all could steer it away from paths it uses on the console, or make it fail. - The host's support masks and quality-level counts differ by adapter, so the title would see different answers on different PCs. What would change the verdict: evidence of what the console reports for these queries, or of what the title does with the answer (the call sites and which bits it tests), plus an answer for the console-only formats that matches what VIctory can actually create for them, rather than zero. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 18:01:35 +00:00
fuzeofficlal commented 2026-11-25 18:02:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-25T17:20:11Z.


Closing this PR: as noted in triage, validating console-specific FORMAT_SUPPORT/MULTISAMPLE query behavior requires runtime call-site evidence from a real title, which I do not have locally. Keeping the PR queue focused on verified changes.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7169355508 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1369#issuecomment-7169355508). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-25T17:20:11Z. --- Closing this PR: as noted in triage, validating console-specific `FORMAT_SUPPORT`/`MULTISAMPLE` query behavior requires runtime call-site evidence from a real title, which I do not have locally. Keeping the PR queue focused on verified changes.

Pull request closed

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!1369
No description provided.