Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Creates a command allocator object.
HRESULT CreateCommandAllocator(
[in] D3D12_COMMAND_LIST_TYPE type,
REFIID riid,
[out] void **ppCommandAllocator
);
[in] type
Type: D3D12_COMMAND_LIST_TYPE
A D3D12_COMMAND_LIST_TYPE-typed value that specifies the type of command allocator to create. The type of command allocator can be the type that records either direct command lists or bundles.
riid
Type: REFIID
The globally unique identifier (GUID) for the command allocator interface (ID3D12CommandAllocator). The REFIID, or GUID, of the interface to the command allocator can be obtained by using the __uuidof() macro. For example, __uuidof(ID3D12CommandAllocator) will get the GUID of the interface to a command allocator.
[out] ppCommandAllocator
Type: void**
A pointer to a memory block that receives a pointer to the ID3D12CommandAllocator interface for the command allocator.
Type: HRESULT
This method returns E_OUTOFMEMORY if there is insufficient memory to create the command allocator. See Direct3D 12 Return Codes for other possible return values.
The device creates command lists from the command allocator.
The D3D12Bundles sample uses ID3D12Device::CreateCommandAllocator as follows:
ThrowIfFailed(pDevice->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&m_commandAllocator)));
ThrowIfFailed(pDevice->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_BUNDLE, IID_PPV_ARGS(&m_bundleAllocator)));
Refer to the Example Code in the D3D12 Reference.
Requirement | Value |
---|---|
Target Platform | Windows |
Header | d3d12.h |
Library | D3D12.lib |
DLL | D3D12.dll |
Events
Apr 8, 3 PM - May 28, 7 AM
Sharpen your AI skills and enter the sweepstakes to win a free Certification exam
Register now!