GPU: expose IDXGIObject on emulated DXGI interfaces #2443

Open
github-bot wants to merge 1 commit from github-bot/gh-2443 into main AGit
Owner

@⁠Damokles2 on GitHub · 2026-11-25 13:38 UTC · original
Damokles2:fix-dxgi-idxgiobject-query-interface → main · +132 −10 · 1 files · 1 commits · open

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.

**@⁠Damokles2** on GitHub · 2026-11-25 13:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2443) `Damokles2:fix-dxgi-idxgiobject-query-interface` → `main` · +132 −10 · 1 files · 1 commits · open ### 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://git.gtahub.st/github/Marvisak--VIctory/issues/1633) AI disclosure: OpenAI Codex assisted with implementation, test design, review, and preparation of the validation workflow. The results above were verified in GitHub Actions.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:05:56 +00:00
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 14:02 UTC · original

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).

**@⁠kotekompotek** on GitHub · 2026-11-25 14:02 UTC · [original](https://github.com/Marvisak/VIctory/pull/2443#issuecomment-7164669502) 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).
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 14:13 UTC · original

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.

**@⁠oni-swr** on GitHub · 2026-11-25 14:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/2443#issuecomment-7164934848) **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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:53 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-25 15:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/2443#issuecomment-7167402565) <!-- 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)_
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2443/head:github-bot/gh-2443'
git switch 'github-bot/gh-2443'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2443'
git switch 'github-bot/gh-2443'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2443'
git switch 'github-bot/gh-2443'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2443'
git switch 'main'
git merge --squash 'github-bot/gh-2443'
git switch 'main'
git merge --ff-only 'github-bot/gh-2443'
git switch 'main'
git merge 'github-bot/gh-2443'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!2443
No description provided.