ID3D12Device::CreateFence method

Creates a fence object.

Syntax

HRESULT CreateFence(
  UINT64            InitialValue,
  D3D12_FENCE_FLAGS Flags,
  REFIID            riid,
  void              **ppFence
);

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: REFIID

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

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

   
Target Platform Windows
Header d3d12.h
Library D3D12.lib
DLL D3D12.dll

See Also

ID3D12Device