Skip to main content
Creates a fence object.

Syntax

Parameters

InitialValue
Type: UINT64
The initial value for the fence. Flags
Type: D3D12_FENCE_FLAGS
A combination of D3D12_FENCE_FLAGS-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for the fence. riid
Type: const IID &
The globally unique identifier (GUID) for the fence interface (ID3D12Fence). The REFIID, or GUID, of the interface to the fence can be obtained by using the __uuidof() macro. For example, __uuidof(ID3D12Fence) will get the GUID of the interface to a fence. ppFence [out]
Type: void **
A pointer to a memory block that receives a pointer to the ID3D12Fence interface that is used to access the fence.

Return value

Type: HRESULT Returns S_OK if successful; otherwise, returns one of the Direct3D 12 Return Codes.

Requirements

Header: d3d12_xs.h or d3d12_x.h
Library: d3d12_xs.lib or d3d12_x.lib
Supported Platforms: XBOX Series consoles and XBOX One family

See Also

ID3D12Device
Last modified on August 20, 2026