Skip to content

Latest commit

 

History

History
132 lines (90 loc) · 4.72 KB

nf-d3d12-id3d12device-createrootsignature.md

File metadata and controls

132 lines (90 loc) · 4.72 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:d3d12.ID3D12Device.CreateRootSignature
ID3D12Device::CreateRootSignature (d3d12.h)
Creates a root signature layout.
CreateRootSignature
CreateRootSignature method
CreateRootSignature method
ID3D12Device interface
ID3D12Device interface
CreateRootSignature method
ID3D12Device.CreateRootSignature
ID3D12Device::CreateRootSignature
d3d12/ID3D12Device::CreateRootSignature
direct3d12.id3d12device_createrootsignature
direct3d12\id3d12device_createrootsignature.htm
direct3d12
CD3389EC-4086-40F0-B1DB-BCBCF9DDE6BA
12/05/2018
CreateRootSignature, CreateRootSignature method, CreateRootSignature method,ID3D12Device interface, ID3D12Device interface,CreateRootSignature method, ID3D12Device.CreateRootSignature, ID3D12Device::CreateRootSignature, d3d12/ID3D12Device::CreateRootSignature, direct3d12.id3d12device_createrootsignature
d3d12.h
Windows
D3D12.lib
D3D12.dll
Windows
19H1
ID3D12Device::CreateRootSignature
d3d12/ID3D12Device::CreateRootSignature
c++
APIRef
kbSyntax
COM
D3D12.dll
ID3D12Device.CreateRootSignature

ID3D12Device::CreateRootSignature

-description

Creates a root signature layout.

-parameters

-param nodeMask [in]

Type: UINT

For single GPU operation, set this to zero. If there are multiple GPU nodes, set bits to identify the nodes (the device's physical adapters) to which the root signature is to apply. Each bit in the mask corresponds to a single node. Refer to Multi-adapter systems.

-param pBlobWithRootSignature [in]

Type: const void*

A pointer to the source data for the serialized signature.

-param blobLengthInBytes [in]

Type: SIZE_T

The size, in bytes, of the block of memory that pBlobWithRootSignature points to.

-param riid

Type: REFIID

The globally unique identifier (GUID) for the root signature interface. See Remarks. An input parameter.

-param ppvRootSignature [out]

Type: void**

A pointer to a memory block that receives a pointer to the root signature.

-returns

Type: HRESULT

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

This method returns E_INVALIDARG if the blob that pBlobWithRootSignature points to is invalid.

-remarks

If an application procedurally generates a D3D12_ROOT_SIGNATURE_DESC data structure, it must pass a pointer to this D3D12_ROOT_SIGNATURE_DESC in a call to D3D12SerializeRootSignature to make the serialized form. The application then passes the serialized form to pBlobWithRootSignature in a call to ID3D12Device::CreateRootSignature.

The REFIID, or GUID, of the interface to the root signature layout can be obtained by using the __uuidof() macro. For example, __uuidof(ID3D12RootSignature) will get the GUID of the interface to a root signature.

Examples

The D3D12HelloTriangle sample uses ID3D12Device::CreateRootSignature as follows:

Create an empty root signature.

CD3DX12_ROOT_SIGNATURE_DESC rootSignatureDesc;
rootSignatureDesc.Init(0, nullptr, 0, nullptr, D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT);

ComPtr<ID3DBlob> signature;
ComPtr<ID3DBlob> error;
ThrowIfFailed(D3D12SerializeRootSignature(&rootSignatureDesc, D3D_ROOT_SIGNATURE_VERSION_1, &signature, &error));
ThrowIfFailed(m_device->CreateRootSignature(0, signature->GetBufferPointer(), signature->GetBufferSize(), IID_PPV_ARGS(&m_rootSignature)));

-see-also

ID3D12Device