GPU: answer format-info and virtual-address feature queries #278

Open
Quat3rnion wants to merge 1 commit from upstream-pr/278 into main
Quat3rnion commented 2026-11-24 02:00:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-24T02:00:19Z.


What

CheckFeatureSupport returned E_NOTIMPL for D3D12 feature IDs 5 and 6.
This answers them with the same size and null validation as the features
already handled:

  • FORMAT_INFO reports one plane for ordinary formats and two for the
    depth/stencil families (including typeless and read-only views).
  • GPU_VIRTUAL_ADDRESS_SUPPORT reports the 40 resource bits already
    published in OPTIONS and 48 bits for the process, since GPU addresses
    are CPU addresses here.

Both are small interfaces with a clear error path, as the plan notes.

An AI tool wrote part of this change.

Tested

  • Linux: cargo test --workspace with PR #112's Linux build fix applied locally (not part of this PR): 166 passed, 0 failed, 3 ignored. Two new tests cover plane counts, address widths and the invalid-size path.
  • Windows cross-build: cargo check --target x86_64-pc-windows-gnu --workspace --tests passes. Windows-only tests were not run; there is no Windows host here.
  • cargo xtask policy passes (150 files ok). No game files or data from them were added.
  • Not tested: a real title or GPU; the values follow this project's own OPTIONS table and address-space setup.

Checklist

  • cargo fmt on the changed hunks; workspace tests and Windows cross-check pass.
  • cargo xtask policy passes. No game files or data from them were added.
  • AI authorship is disclosed above.
<!-- greyfinch-sync:Marvisak/VIctory:issue:5464644016 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/278). Originally posted by [Quat3rnion](https://github.com/Quat3rnion) on 2026-11-24T02:00:19Z. --- ## What `CheckFeatureSupport` returned `E_NOTIMPL` for D3D12 feature IDs 5 and 6. This answers them with the same size and null validation as the features already handled: - `FORMAT_INFO` reports one plane for ordinary formats and two for the depth/stencil families (including typeless and read-only views). - `GPU_VIRTUAL_ADDRESS_SUPPORT` reports the 40 resource bits already published in OPTIONS and 48 bits for the process, since GPU addresses are CPU addresses here. Both are small interfaces with a clear error path, as the plan notes. An AI tool wrote part of this change. ## Tested - Linux: `cargo test --workspace` with PR #112's Linux build fix applied locally (not part of this PR): 166 passed, 0 failed, 3 ignored. Two new tests cover plane counts, address widths and the invalid-size path. - Windows cross-build: `cargo check --target x86_64-pc-windows-gnu --workspace --tests` passes. Windows-only tests were not run; there is no Windows host here. - `cargo xtask policy` passes (150 files ok). No game files or data from them were added. - Not tested: a real title or GPU; the values follow this project's own OPTIONS table and address-space setup. ## Checklist - [x] `cargo fmt` on the changed hunks; workspace tests and Windows cross-check pass. - [x] `cargo xtask policy` passes. No game files or data from them were added. - [x] AI authorship is disclosed above.
jeremygold02 commented 2026-11-24 06:55:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:12:07Z.


Tested PR #278 at head c90d3c05ab98b9d859863f404fa8293f08450821 (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at c90d3c05ab98b9d859863f404fa8293f08450821.

  • cargo test --locked -p victory-gpu format_info_reports_the_planes_of_depth_formats — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 40 filtered out; finished in 0.00s ); cases: device::tests::format_info_reports_the_planes_of_depth_formats.
  • cargo test --locked -p victory-gpu virtual_address_support_matches_the_reported_address_space — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 40 filtered out; finished in 0.00s ); cases: device::tests::virtual_address_support_matches_the_reported_address_space.

Behavior covered: Checks depth-format plane counts and that virtual-address support matches the reported address space.
Code: crates/victory-gpu/src/device.rs

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121800383 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/278#issuecomment-7121800383). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T04:12:07Z. --- Tested PR #278 at head `c90d3c05ab98b9d859863f404fa8293f08450821` (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at `c90d3c05ab98b9d859863f404fa8293f08450821`. - `cargo test --locked -p victory-gpu format_info_reports_the_planes_of_depth_formats` — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 40 filtered out; finished in 0.00s ); cases: device::tests::format_info_reports_the_planes_of_depth_formats. - `cargo test --locked -p victory-gpu virtual_address_support_matches_the_reported_address_space` — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 40 filtered out; finished in 0.00s ); cases: device::tests::virtual_address_support_matches_the_reported_address_space. Behavior covered: Checks depth-format plane counts and that virtual-address support matches the reported address space. Code: [crates/victory-gpu/src/device.rs](https://github.com/Marvisak/VIctory/blob/c90d3c05ab98b9d859863f404fa8293f08450821/crates/victory-gpu/src/device.rs)
mercuryVM commented 2026-11-24 09:04:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T09:04:55Z.

Review: APPROVED


Tested cbf3584 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (249 passed, 0 failed; older base), including both new tests.

  • Both struct sizes are right: D3D12_FEATURE_DATA_FORMAT_INFO is a DXGI_FORMAT plus a UINT8, padded to 8, and …_GPU_VIRTUAL_ADDRESS_SUPPORT is two UINTs. Writing a u32 at the plane-count slot stays inside the 8 bytes, and the low byte lands on PlaneCount.
  • The depth/stencil families 19–22 and 44–47 are the two-plane formats D3D12 reports.
  • Nit: the planar video formats are also two planes on D3D12: NV12 103, P010 104, P016 105, NV11 110, P208 130, V208 131 and V408 132. If any media path asks, this would report 1. That's unlikely for this title, but cheap to add.
  • GPU_VIRTUAL_ADDRESS_SUPPORT reuses OPTIONS[9] for the per-resource bits, so the two queries can't disagree.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6036369363 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/278#pullrequestreview-6036369363). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T09:04:55Z. **Review:** APPROVED --- Tested cbf3584 on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (249 passed, 0 failed; older base), including both new tests. - Both struct sizes are right: `D3D12_FEATURE_DATA_FORMAT_INFO` is a `DXGI_FORMAT` plus a `UINT8`, padded to 8, and `…_GPU_VIRTUAL_ADDRESS_SUPPORT` is two `UINT`s. Writing a `u32` at the plane-count slot stays inside the 8 bytes, and the low byte lands on `PlaneCount`. - The depth/stencil families 19–22 and 44–47 are the two-plane formats D3D12 reports. - Nit: the planar video formats are also two planes on D3D12: `NV12` 103, `P010` 104, `P016` 105, `NV11` 110, `P208` 130, `V208` 131 and `V408` 132. If any media path asks, this would report 1. That's unlikely for this title, but cheap to add. - `GPU_VIRTUAL_ADDRESS_SUPPORT` reuses `OPTIONS[9]` for the per-resource bits, so the two queries can't disagree. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 01:07:46 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-gpu/src/device.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148494845 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/278#issuecomment-7148494845). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:25:28Z. --- <!-- victory-triage v1 head=d063cee543a2a0a23fd99ce4c84ffe7e9a64d5d2 verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-gpu/src/device.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
andrewpozdnakov7-jpg commented 2026-11-28 19:47:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T19:47:28Z.


I compared the FORMAT_INFO result with native D3D12 on WARP 1.0.22 with Agility 1.620.2. On the initial 18 formats, main 63bcca4 returned E_NOTIMPL for all of them. This PR at 425406c matched D3D12 on 15/18. The differences were NV12, P010 and P016. The PR reported one plane for each and WARP reported two. The color, BC, depth/stencil, typeless and depth/stencil view cases agreed.

I then checked five more formats. WARP returned one plane for 420_OPAQUE, two for NV11, and E_INVALIDARG for P208, V208 and V408 in both debug modes. The guest answers S_OK with one plane for those last three. The patch adds the four confirmed two-plane video formats and extends the existing regression. On 09c049e, all 20 successful native queries matched and the same three HRESULT differences remain. DXGI format reference

I repeated the 23 queries on a GeForce GTX 750 Ti (driver 32.0.15.6094) and on the explicit WARP adapter. The D3D12 device identified the selected adapter in both cases. I tested the system runtime (10.0.19041.5794) and app-local Agility 1.620.2 on each adapter. All four runs matched 09c049e for the same 20 formats. The same three queries for P208, V208 and V408 returned E_INVALIDARG in every run. The hardware check used a native feature-level 11.0 device and queried format metadata only.

The branch passed 248 GPU diagnostics tests with one ignored, with the D3D12 debug layer off and on. Clippy passed with default features and diagnostics, and the asset policy check passed. These tests cover the format query.

Follow-up branch. Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the follow-up into another commit.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7244807172 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/278#issuecomment-7244807172). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T19:47:28Z. --- I compared the `FORMAT_INFO` result with native D3D12 on WARP 1.0.22 with Agility 1.620.2. On the initial 18 formats, main `63bcca4` returned `E_NOTIMPL` for all of them. This PR at `425406c` matched D3D12 on 15/18. The differences were NV12, P010 and P016. The PR reported one plane for each and WARP reported two. The color, BC, depth/stencil, typeless and depth/stencil view cases agreed. I then checked five more formats. WARP returned one plane for 420_OPAQUE, two for NV11, and `E_INVALIDARG` for P208, V208 and V408 in both debug modes. The guest answers `S_OK` with one plane for those last three. The patch adds the four confirmed two-plane video formats and extends the existing regression. On [`09c049e`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/09c049ef24ab774580695d92873cdf28b9ad4109), all 20 successful native queries matched and the same three HRESULT differences remain. [DXGI format reference](https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format) I repeated the 23 queries on a GeForce GTX 750 Ti (driver `32.0.15.6094`) and on the explicit WARP adapter. The D3D12 device identified the selected adapter in both cases. I tested the system runtime (`10.0.19041.5794`) and app-local Agility `1.620.2` on each adapter. All four runs matched `09c049e` for the same 20 formats. The same three queries for P208, V208 and V408 returned `E_INVALIDARG` in every run. The hardware check used a native feature-level 11.0 device and queried format metadata only. The branch passed 248 GPU diagnostics tests with one ignored, with the D3D12 debug layer off and on. Clippy passed with default features and diagnostics, and the asset policy check passed. These tests cover the format query. [Follow-up branch](https://github.com/andrewpozdnakov7-jpg/VIctory/tree/review/278-planar-format-info). Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the follow-up into another commit. AI-assisted with OpenAI Codex.
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/278:upstream-pr/278'
git switch 'upstream-pr/278'

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