GPU: fences answer for ID3D12Fence1 as documented #1562

Manually merged
github merged 1 commit from gh-pr/1562/head into gh-pr/1562/base 2026-11-26 04:36:31 +00:00
Owner

@⁠BastienRodz on GitHub · 2026-11-24 19:12 UTC · original
BastienRodz:gpu/fence1-iid → main · +41 −1 · 1 files · 1 commits · merged 2026-11-25 00:23 UTC

What's wrong

crates/victory-gpu/src/fence.rs already implements ID3D12Fence1::GetCreationFlags at vtable slot 11 (0x58), but FENCE_IIDS only contains ID3D12Fence and PAGEABLE_IIDS. Calling ID3D12Device::CreateFence or IUnknown::QueryInterface with IID_ID3D12Fence1 (433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a) fails with E_NOINTERFACE (0x80004002) and writes null, contrary to Microsoft's ID3D12Fence1 documentation (ID3D12Fence1).

What the fix does

  • Adds ID3D12Fence1 (433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a) to FENCE_IIDS in crates/victory-gpu/src/fence.rs (keeping ID3D12Fence at index 0).
  • Adds a unit test fence::tests::fence1_interface_is_created_and_queried verifying direct creation as ID3D12Fence1, GetCreationFlags at slot 0x58, and QueryInterface from ID3D12Fence to ID3D12Fence1.

Tests

  • Test: fence::tests::fence1_interface_is_created_and_queried (does not depend on a host D3D12 device).
  • Failure on main (ffe310e) before the fix:
thread 'fence::tests::fence1_interface_is_created_and_queried' (292) panicked at
 crates/victory-gpu/src/fence.rs:188:9:
assertion `left == right` failed
  left: -2147467262
 right: 0
  • Local results (Linux host cross-compiling to x86_64-pc-windows-msvc, tests run under Wine):
    • cargo xwin test -p victory-gpu --target x86_64-pc-windows-msvc: 51 passed, 0 failed, 1 ignored (fence1_interface_is_created_and_queried passes).
    • cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings: pass.
    • cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings: pass.
    • cargo xtask policy: pass (asset policy: 154 files ok).
    • rustfmt --edition 2024 --check crates/victory-gpu/src/fence.rs: pass.
  • On GitHub's windows-latest with the upstream CI's commands (clippy -D warnings with and without --all-features, then cargo test --workspace --locked), everything passes; victory-gpu 51 passed, 0 failed: https://github.com/BastienRodz/VIctory/actions/runs/45467227051

Not tested: a title that asks for ID3D12Fence1 (none is known to; Grand Theft Auto VI reaches the world without it).

Fixes #1561.

No game data used. AI-assisted: found and implemented with Gemini 4 Neon, reviewed and verified with Claude Code.

🤖 Generated with Claude Code

**@⁠BastienRodz** on GitHub · 2026-11-24 19:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/1562) `BastienRodz:gpu/fence1-iid` → `main` · +41 −1 · 1 files · 1 commits · merged 2026-11-25 00:23 UTC ## What's wrong `crates/victory-gpu/src/fence.rs` already implements `ID3D12Fence1::GetCreationFlags` at vtable slot 11 (`0x58`), but `FENCE_IIDS` only contains `ID3D12Fence` and `PAGEABLE_IIDS`. Calling `ID3D12Device::CreateFence` or `IUnknown::QueryInterface` with `IID_ID3D12Fence1` (`433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a`) fails with `E_NOINTERFACE` (`0x80004002`) and writes null, contrary to Microsoft's `ID3D12Fence1` documentation ([ID3D12Fence1](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nn-d3d12-id3d12fence1)). ## What the fix does - Adds `ID3D12Fence1` (`433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a`) to `FENCE_IIDS` in `crates/victory-gpu/src/fence.rs` (keeping `ID3D12Fence` at index `0`). - Adds a unit test `fence::tests::fence1_interface_is_created_and_queried` verifying direct creation as `ID3D12Fence1`, `GetCreationFlags` at slot `0x58`, and `QueryInterface` from `ID3D12Fence` to `ID3D12Fence1`. ## Tests - Test: `fence::tests::fence1_interface_is_created_and_queried` (does not depend on a host D3D12 device). - Failure on `main` (`ffe310e`) before the fix: ```text thread 'fence::tests::fence1_interface_is_created_and_queried' (292) panicked at crates/victory-gpu/src/fence.rs:188:9: assertion `left == right` failed left: -2147467262 right: 0 ``` - Local results (Linux host cross-compiling to `x86_64-pc-windows-msvc`, tests run under Wine): - `cargo xwin test -p victory-gpu --target x86_64-pc-windows-msvc`: 51 passed, 0 failed, 1 ignored (`fence1_interface_is_created_and_queried` passes). - `cargo xwin clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings`: pass. - `cargo xwin clippy --workspace --all-targets --all-features --locked --target x86_64-pc-windows-msvc -- -D warnings`: pass. - `cargo xtask policy`: pass (`asset policy: 154 files ok`). - `rustfmt --edition 2024 --check crates/victory-gpu/src/fence.rs`: pass. - On GitHub's `windows-latest` with the upstream CI's commands (clippy `-D warnings` with and without `--all-features`, then `cargo test --workspace --locked`), everything passes; `victory-gpu` 51 passed, 0 failed: https://github.com/BastienRodz/VIctory/actions/runs/45467227051 Not tested: a title that asks for `ID3D12Fence1` (none is known to; Grand Theft Auto VI reaches the world without it). Fixes #1561. No game data used. AI-assisted: found and implemented with Gemini 4 Neon, reviewed and verified with Claude Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fence.rs already implements ID3D12Fence1::GetCreationFlags at slot 11
(0x58), but FENCE_IIDS only listed ID3D12Fence and PAGEABLE_IIDS, so
CreateFence and QueryInterface rejected ID3D12Fence1 with E_NOINTERFACE.

Add ID3D12Fence1 (433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a) to FENCE_IIDS
and add a unit test covering creation, QueryInterface, and
GetCreationFlags.

Co-Authored-By: Gemini 4 Neon <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:36:30 +00:00
github manually merged commit bbdc3ca724 into gh-pr/1562/base 2026-11-26 04:36:31 +00:00
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!1562
No description provided.