GPU: expose IDXGIObject on emulated DXGI interfaces #2441

Open
Damokles2 wants to merge 1 commit from upstream-pr/2443 into main
Damokles2 commented 2026-11-25 13:38:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Damokles2 on 2026-11-25T13:38:24Z.


Problem

The emulated DXGI device, adapter, factory, and output expose the inherited IDXGIObject vtable prefix, but their QueryInterface discovery lists omit IID_IDXGIObject. Code querying that base interface receives E_NOINTERFACE.

Fix

Append IID_IDXGIObject to the four discovery lists. Existing interface pointers, canonical IUnknown identity, reference ownership, and private-data behavior are preserved. This change covers interface discovery. The existing private-data stubs remain.

The regression uses the actual emulated COM vtables and checks interface discovery, canonical identity, derived-interface round trips, implemented parent queries, and rejection of an unsupported IID.

Regression and validation

The test-only baseline at 940d32f69b22265690a0b5a15d6ded572ba33baf compiled and ran exactly one regression. Each QueryInterface call returned E_NOINTERFACE (0x80004002) with a null output pointer.

Baseline object HRESULT Output
IDXGIDevice E_NOINTERFACE null
IDXGIAdapter E_NOINTERFACE null
IDXGIFactory E_NOINTERFACE null
IDXGIOutput E_NOINTERFACE null

The same regression passed with the fix. The fork-only Windows-MSVC run validated contribution commit d4672a6f15f9c944a4d0bbd856b6b2aec1e81d74.

  • Exact regression: 1 passed.
  • DXGI module: 3 passed.
  • Object module: 4 passed, 1 benchmark ignored.
  • Device identity test: 1 passed.
  • Strict MSVC Clippy, scoped rustfmt, and git diff --check: passed.

Validation ran selected CPU-only tests. The full package and workspace suites, native GPU execution, and game compatibility were outside its scope.

Microsoft IDXGIObject documentation · Existing coordination claim

AI disclosure: OpenAI Codex assisted with implementation, test design, review, and preparation of the validation workflow. The results above were verified in GitHub Actions.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6605763982 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2443). Originally posted by [Damokles2](https://github.com/Damokles2) on 2026-11-25T13:38:24Z. --- ### Problem The emulated DXGI device, adapter, factory, and output expose the inherited IDXGIObject vtable prefix, but their QueryInterface discovery lists omit IID_IDXGIObject. Code querying that base interface receives E_NOINTERFACE. ### Fix Append IID_IDXGIObject to the four discovery lists. Existing interface pointers, canonical IUnknown identity, reference ownership, and private-data behavior are preserved. This change covers interface discovery. The existing private-data stubs remain. The regression uses the actual emulated COM vtables and checks interface discovery, canonical identity, derived-interface round trips, implemented parent queries, and rejection of an unsupported IID. ### Regression and validation The test-only baseline at `940d32f69b22265690a0b5a15d6ded572ba33baf` compiled and ran exactly one regression. Each QueryInterface call returned E_NOINTERFACE (`0x80004002`) with a null output pointer. | Baseline object | HRESULT | Output | | --- | --- | --- | | IDXGIDevice | E_NOINTERFACE | null | | IDXGIAdapter | E_NOINTERFACE | null | | IDXGIFactory | E_NOINTERFACE | null | | IDXGIOutput | E_NOINTERFACE | null | The same regression passed with the fix. The [fork-only Windows-MSVC run](https://github.com/Damokles2/VIctory/actions/runs/45620356173) validated contribution commit `d4672a6f15f9c944a4d0bbd856b6b2aec1e81d74`. - Exact regression: 1 passed. - DXGI module: 3 passed. - Object module: 4 passed, 1 benchmark ignored. - Device identity test: 1 passed. - Strict MSVC Clippy, scoped rustfmt, and git diff --check: passed. Validation ran selected CPU-only tests. The full package and workspace suites, native GPU execution, and game compatibility were outside its scope. [Microsoft IDXGIObject documentation](https://learn.microsoft.com/en-us/windows/win32/api/dxgi/nn-dxgi-idxgiobject) · [Existing coordination claim](https://github.com/Marvisak/VIctory/issues/1633#issuecomment-7162575439) AI disclosure: OpenAI Codex assisted with implementation, test design, review, and preparation of the validation workflow. The results above were verified in GitHub Actions.
DenRakEiw commented 2026-11-25 14:07:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T13:58:22Z.

Review: APPROVED


Verified against origin/main (940d32f):

  • Exposing IDXGIObject on emulated DXGI interfaces is clean and well-tested.
  • cargo test -p victory-gpu dxgi::: 3/3 passed (including dxgi_interfaces_expose_their_base_object).
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6058952214 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2443#pullrequestreview-6058952214). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T13:58:22Z. **Review:** APPROVED --- Verified against `origin/main` (`940d32f`): - Exposing `IDXGIObject` on emulated DXGI interfaces is clean and well-tested. - `cargo test -p victory-gpu dxgi::`: 3/3 passed (including `dxgi_interfaces_expose_their_base_object`). - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: 0 warnings. - `cargo xtask policy`: 183 files ok. AI-assisted (Gemini 4 Neon).
kotekompotek commented 2026-11-25 14:07:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T14:02:37Z.


Correct minimal fix: the emulated vtables already carry the IDXGIObject methods (GetParent at 0x30 works — the parent test passes), only the IID was missing from the query tables, so a QueryInterface for the base interface failed where PC returns the same pointer. The test pins the full COM contract: canonical IUnknown identity, same-vtable base, round-trip query, parent chain, and clean rejection of unknown IIDs (no stale pointer left).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7164669502 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2443#issuecomment-7164669502). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T14:02:37Z. --- Correct minimal fix: the emulated vtables already carry the IDXGIObject methods (GetParent at 0x30 works — the parent test passes), only the IID was missing from the query tables, so a QueryInterface for the base interface failed where PC returns the same pointer. The test pins the full COM contract: canonical IUnknown identity, same-vtable base, round-trip query, parent chain, and clean rejection of unknown IIDs (no stale pointer left).
catminou4 commented 2026-11-25 15:03:42 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Expose IDXGIObject on emulated DXGI interfaces. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.

<!-- greyfinch-sync:Marvisak/VIctory:review:6059177995 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2443#pullrequestreview-6059177995). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T14:11:20Z. **Review:** COMMENTED --- Expose IDXGIObject on emulated DXGI interfaces. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
oni-swr commented 2026-11-25 15:04:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-25T14:13:01Z.


Independent WARP verification of #2443 at d4672a6

Commands (Rust 1.98.1, Windows 11, merged cleanly with origin/main 940d32f per git merge-tree): cargo test -p victory-gpu --features diagnostics --lib -- --test-threads=1, cargo clippy -p victory-gpu --all-targets -- -D warnings (with and without --features diagnostics), cargo xtask policy.

  • lib tests: 147 passed, 0 failed, 2 ignored (includes dxgi_interfaces_expose_their_base_object); clippy clean both ways; policy OK.
  • Negative control: dxgi.rs reverted to origin/main with the new test kept -> the test FAILS, so it covers the added IDXGIObject IID on device/adapter/factory/output.
  • Diff: IID appended at the end of each table, so existing indices (DEVICE_IIDS[0] etc.) are unchanged.

AI-assisted verification by Claude Code (Claude Sonnet 5.5). Software-only: Microsoft Basic Render Driver (WARP, vendor 0x1414, forced by VICTORY_D3D12_WARP=1 + --features diagnostics; warp_adapter() refuses a non-software adapter), no physical GPU, no game files, dumps or hashes.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7164934848 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2443#issuecomment-7164934848). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T14:13:01Z. --- **Independent WARP verification of #2443 at `d4672a6`** Commands (Rust 1.98.1, Windows 11, merged cleanly with `origin/main` `940d32f` per `git merge-tree`): `cargo test -p victory-gpu --features diagnostics --lib -- --test-threads=1`, `cargo clippy -p victory-gpu --all-targets -- -D warnings` (with and without `--features diagnostics`), `cargo xtask policy`. - lib tests: 147 passed, 0 failed, 2 ignored (includes `dxgi_interfaces_expose_their_base_object`); clippy clean both ways; policy OK. - Negative control: `dxgi.rs` reverted to `origin/main` with the new test kept -> the test FAILS, so it covers the added IDXGIObject IID on device/adapter/factory/output. - Diff: IID appended at the end of each table, so existing indices (`DEVICE_IIDS[0]` etc.) are unchanged. AI-assisted verification by Claude Code (Claude Sonnet 5.5). Software-only: Microsoft Basic Render Driver (WARP, vendor 0x1414, forced by `VICTORY_D3D12_WARP=1` + `--features diagnostics`; `warp_adapter()` refuses a non-software adapter), no physical GPU, no game files, dumps or hashes.
Marvisak commented 2026-11-25 16:09:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:53:23Z.


Automated triage for the maintainers.

Merge candidate. It appends the IDXGIObject IID ({aec22fb8-76f3-4639-9be0-28eb43a67a2e}, checked against the public documentation) to DEVICE_IIDS, ADAPTER_IIDS, FACTORY_IIDS and OUTPUT_IIDS in crates/victory-gpu/src/dxgi.rs, so a QueryInterface for the base interface returns the same object, as COM requires; the entries go at the end, so the indexed uses (ADAPTER_IIDS[0], OUTPUT_IIDS[0], the tests' [2]) are unchanged, and device.rs routing the D3D12 device's query through DEVICE_IIDS stays consistent. The new test exercises the real vtables and fails on main. CI: passing.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167402565 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2443#issuecomment-7167402565). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:53:23Z. --- <!-- victory-triage v1 head=d4672a6f15f9c944a4d0bbd856b6b2aec1e81d74 verdict=merge-candidate at=2026-11-25T15:53:11Z --> Automated triage for the maintainers. Merge candidate. It appends the IDXGIObject IID ({aec22fb8-76f3-4639-9be0-28eb43a67a2e}, checked against the public documentation) to `DEVICE_IIDS`, `ADAPTER_IIDS`, `FACTORY_IIDS` and `OUTPUT_IIDS` in `crates/victory-gpu/src/dxgi.rs`, so a QueryInterface for the base interface returns the same object, as COM requires; the entries go at the end, so the indexed uses (`ADAPTER_IIDS[0]`, `OUTPUT_IIDS[0]`, the tests' `[2]`) are unchanged, and `device.rs` routing the D3D12 device's query through `DEVICE_IIDS` stays consistent. The new test exercises the real vtables and fails on main. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
fuzeofficlal commented 2026-11-26 03:03:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T02:20:40Z.

Review: COMMENTED


Reviewed and verified against main (63bcca43) on Windows 11 (RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1) — clean and ready to merge:

  • Appending IDXGI_OBJECT_IID ({aec22fb8-76f3-4639-9be0-28eb43a67a2e}) to DEVICE_IIDS, ADAPTER_IIDS, FACTORY_IIDS, and OUTPUT_IIDS exposes IDXGIObject through both QueryInterface and GetParent without shifting existing [0] default indices.

Local verification:

  • victory-gpu (dxgi:: 3/3, device:: 8/8 on both RTX 5090 and WARP, default & --features diagnostics, VICTORY_D3D12_DEBUG=1)
  • cargo clippy --all-targets -p victory-gpu -- -D warnings (default & --features diagnostics) + cargo xtask policy (191 files ok): 0 warnings
<!-- greyfinch-sync:Marvisak/VIctory:review:6067704709 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2443#pullrequestreview-6067704709). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T02:20:40Z. **Review:** COMMENTED --- Reviewed and verified against `main` (`63bcca43`) on Windows 11 (RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`) — clean and ready to merge: - Appending `IDXGI_OBJECT_IID` (`{aec22fb8-76f3-4639-9be0-28eb43a67a2e}`) to `DEVICE_IIDS`, `ADAPTER_IIDS`, `FACTORY_IIDS`, and `OUTPUT_IIDS` exposes `IDXGIObject` through both `QueryInterface` and `GetParent` without shifting existing `[0]` default indices. **Local verification**: - `victory-gpu` (`dxgi::` **3/3**, `device::` **8/8** on both **RTX 5090** and **WARP**, default & `--features diagnostics`, `VICTORY_D3D12_DEBUG=1`) - `cargo clippy --all-targets -p victory-gpu -- -D warnings` (default & `--features diagnostics`) + `cargo xtask policy` (`191 files ok`): 0 warnings
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/2443:upstream-pr/2443'
git switch 'upstream-pr/2443'

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