GPU: fences answer for ID3D12Fence1 as documented #1561

Merged
BastienRodz merged 1 commit from upstream-pr/1562 into main 2026-11-25 00:23:13 +00:00
BastienRodz commented 2026-11-24 19:12:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-24T19:12:25Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6589425986 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1562). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-24T19:12:25Z. --- ## 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)
DenRakEiw commented 2026-11-24 20:02:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T19:30:41Z.

Review: APPROVED


Verified locally merged onto origin/main (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu — 51 passed, 0 failed (1 ignored) on both RTX 5090 hardware and VICTORY_D3D12_WARP=1 (including fence1_interface_is_created_and_queried)
  • cargo clippy -p victory-gpu --all-targets — 0 warnings
  • cargo xtask policy — ok

Clean ID3D12Fence1 QI/creation support with unit test coverage. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6045959481 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1562#pullrequestreview-6045959481). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T19:30:41Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu` — 51 passed, 0 failed (1 ignored) on both RTX 5090 hardware and `VICTORY_D3D12_WARP=1` (including `fence1_interface_is_created_and_queried`) - `cargo clippy -p victory-gpu --all-targets` — 0 warnings - `cargo xtask policy` — ok Clean `ID3D12Fence1` QI/creation support with unit test coverage. Looks good. AI-assisted (Gemini 4 Neon).
upstream-sync closed this pull request 2026-11-25 01:06:51 +00:00
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!1561
No description provided.