ID3D11Device5::CreateFence method (d3d11_4.h)

Creates a fence object.

This member function is equivalent to the Direct3D 12 ID3D12Device::CreateFence member function, and applies between Direct3D 11 and Direct3D 12 in interop scenarios.

Syntax

HRESULT CreateFence(
        UINT64           InitialValue,
        D3D11_FENCE_FLAG Flags,
        REFIID           ReturnedInterface,
  [out] void             **ppFence
);

Parameters

InitialValue

Type: UINT64

The initial value for the fence.

Flags

Type: D3D11_FENCE_FLAG

A combination of D3D11_FENCE_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies options for the fence.

ReturnedInterface

Type: REFIID

The globally unique identifier (GUID) for the fence interface (ID3D11Fence). The REFIID, or GUID, of the interface to the fence can be obtained by using the __uuidof() macro. For example, __uuidof(ID3D11Fence) will get the GUID of the interface to a fence.

[out] ppFence

Type: void**

A pointer to a memory block that receives a pointer to the ID3D11Fence interface that is used to access the fence.

Return value

Type: HRESULT

Returns S_OK if successful; otherwise, returns one of the Direct3D 11 Return Codes.

Requirements

Requirement Value
Target Platform Windows
Header d3d11_4.h
Library D3d11.lib

See also

ID3D11Device5

UnregisterDeviceRemoved