GPU: CreateFence and QueryInterface reject ID3D12Fence1 with E_NOINTERFACE #1561

Closed
opened 2026-11-26 04:36:29 +00:00 by github-bot · 0 comments
Owner

@⁠BastienRodz on GitHub · 2026-11-24 19:12 UTC · original

What's wrong

Microsoft's ID3D12Fence1 reference (ID3D12Fence1 interface) documents:

Represents a fence. This interface extends ID3D12Fence, and supports the retrieval of the flags used to create the original fence.

ID3D12Fence1 was introduced in the Windows 10 Fall Creators Update, and is the latest version of the ID3D12Fence interface. Applications targeting Windows 10 Fall Creators Update and later should use ID3D12Fence1 instead of earlier versions.

crates/victory-gpu/src/fence.rs already implements ID3D12Fence1::GetCreationFlags at vtable slot 11 (0x58), and its table comment lists fence 1:

pub(crate) const FENCE_IIDS: [Iid; 4] = [
    guid(
        0x0a753dcf,
        0xc4d8,
        0x4b91,
        [0xad, 0xf6, 0xbe, 0x5a, 0x60, 0xd9, 0x5a, 0x76],
    ),
    PAGEABLE_IIDS[0],
    PAGEABLE_IIDS[1],
    PAGEABLE_IIDS[2],
];
/// IUnknown 3, object 4, device child 1, fence 3, fence 1 (2, a console
/// one among them).
static FUNCTIONS: Table<24> = {
    ...
    f[11] = creation_flags as *const (); // 0x58

Because ID3D12Fence1 (433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a) is absent from FENCE_IIDS, both fence::create (ID3D12Device::CreateFence) and fence::query (IUnknown::QueryInterface) reject it:

  • ID3D12Device::CreateFence(3, 0x5, __uuidof(ID3D12Fence1), &out)
    • Expected: S_OK (0), out receives the fence, and GetCreationFlags() returns 0x5.
    • Actual: E_NOINTERFACE (0x80004002 / -2147467262) and out is set to null.
  • fence->QueryInterface(__uuidof(ID3D12Fence1), &out)
    • Expected: S_OK (0), out receives the same fence pointer.
    • Actual: E_NOINTERFACE (0x80004002) and out is set to null.

Impact

A title or engine layer that creates its fences as ID3D12Fence1, or queries one to call GetCreationFlags, gets E_NOINTERFACE and no fence, even though the method is already wired. No log so far shows Grand Theft Auto VI doing this (it reaches the world), so this matters for other callers of the documented interface, not for a known failure.

Fix

Add ID3D12Fence1's GUID (433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a) to FENCE_IIDS in crates/victory-gpu/src/fence.rs, and add a synthetic unit test covering both CreateFence and QueryInterface with ID3D12Fence1 as well as GetCreationFlags at slot 0x58.

A fix with a test is ready; PR to follow.

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

**@⁠BastienRodz** on GitHub · 2026-11-24 19:12 UTC · [original](https://github.com/Marvisak/VIctory/issues/1561) ## What's wrong Microsoft's `ID3D12Fence1` reference ([ID3D12Fence1 interface](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nn-d3d12-id3d12fence1)) documents: > Represents a fence. This interface extends **ID3D12Fence**, and supports the retrieval of the flags used to create the original fence. > > **ID3D12Fence1** was introduced in the Windows 10 Fall Creators Update, and is the latest version of the **ID3D12Fence** interface. Applications targeting Windows 10 Fall Creators Update and later should use **ID3D12Fence1** instead of earlier versions. `crates/victory-gpu/src/fence.rs` already implements `ID3D12Fence1::GetCreationFlags` at vtable slot 11 (`0x58`), and its table comment lists `fence 1`: ```rust pub(crate) const FENCE_IIDS: [Iid; 4] = [ guid( 0x0a753dcf, 0xc4d8, 0x4b91, [0xad, 0xf6, 0xbe, 0x5a, 0x60, 0xd9, 0x5a, 0x76], ), PAGEABLE_IIDS[0], PAGEABLE_IIDS[1], PAGEABLE_IIDS[2], ]; ``` ```rust /// IUnknown 3, object 4, device child 1, fence 3, fence 1 (2, a console /// one among them). static FUNCTIONS: Table<24> = { ... f[11] = creation_flags as *const (); // 0x58 ``` Because `ID3D12Fence1` (`433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a`) is absent from `FENCE_IIDS`, both `fence::create` (`ID3D12Device::CreateFence`) and `fence::query` (`IUnknown::QueryInterface`) reject it: - `ID3D12Device::CreateFence(3, 0x5, __uuidof(ID3D12Fence1), &out)` - Expected: `S_OK` (`0`), `out` receives the fence, and `GetCreationFlags()` returns `0x5`. - Actual: `E_NOINTERFACE` (`0x80004002` / `-2147467262`) and `out` is set to null. - `fence->QueryInterface(__uuidof(ID3D12Fence1), &out)` - Expected: `S_OK` (`0`), `out` receives the same fence pointer. - Actual: `E_NOINTERFACE` (`0x80004002`) and `out` is set to null. ## Impact A title or engine layer that creates its fences as `ID3D12Fence1`, or queries one to call `GetCreationFlags`, gets `E_NOINTERFACE` and no fence, even though the method is already wired. No log so far shows Grand Theft Auto VI doing this (it reaches the world), so this matters for other callers of the documented interface, not for a known failure. ## Fix Add `ID3D12Fence1`'s GUID (`433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a`) to `FENCE_IIDS` in `crates/victory-gpu/src/fence.rs`, and add a synthetic unit test covering both `CreateFence` and `QueryInterface` with `ID3D12Fence1` as well as `GetCreationFlags` at slot `0x58`. A fix with a test is ready; PR to follow. No game data used. AI-assisted: found with Gemini 4 Neon, reviewed with Claude Code.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:36:29 +00:00
This discussion has been locked. Commenting is limited to contributors.
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#1561
No description provided.