Direct3D 12 Functions
This section provides detailed information about the functions available in the Direct3D 12 API. Explore the various categories to understand how to interact with the graphics hardware.
Core Functions
Creates a Direct3D 12 device object for a specified graphics adapter.
View DetailsCreates a committed resource, which is a resource whose memory is fully managed by the Direct3D runtime.
View DetailsDraws indexed or non-indexed geometry. For each instance, it draws VertexCountPerInstance
vertices.
Pipeline State Functions
Creates a graphics pipeline state object (PSO).
View DetailsResource Management Functions
Creates a command allocator object.
View DetailsCreates a command list object.
View DetailsSynchronization Functions
Creates a fence object.
View DetailsD3D12CreateDevice
Creates a Direct3D 12 device object for a specified graphics adapter.
Syntax
HRESULT D3D12CreateDevice(
[in] IUnknown* pAdapter,
[in] D3D_FEATURE_LEVEL FeatureLevel,
[in] REFIID riid,
[out] void** ppDevice
);
Parameters
Parameter | Description |
---|---|
pAdapter |
A pointer to an existing Direct3D 11.1 runtime device's IDXGIAdapter interface. This parameter is required. |
FeatureLevel |
A D3D_FEATURE_LEVEL-typed value that specifies the feature level for the device to be created. |
riid |
The globally unique identifier (GUID) for the Direct3D 12 device interface (__uuidof(ID3D12Device) ). |
ppDevice |
A pointer to a memory block that receives a pointer to the Direct3D 12 device. |
Return Value
Returns S_OK
on success, or one of the Direct3D 12 return codes defined in d3d12.h
.
D3D12GetDeviceRemovedReason
to get the reason for device removal after D3D12CreateDevice
returns a failure.