Syntax
Members
SizeInBytesType: SIZE_T SAL:
In
Specifies the size of the opaque data structure pointed to by the pPipelineStateSubobjectStream member, in bytes.
pPipelineStateSubobjectStreamType: void * SAL:
In_reads(Inexpressible(“Dependentonsizeofsubobjects”))
Specifies the address of a data structure that describes as a bytestream an arbitrary pipeline state subobject.
Remarks
Use this structure with the ID3D12Device2::CreatePipelineState method to create pipeline state objects. The format of the provided stream should consist of an alternating set of D3D12_PIPELINE_STATE_SUBOBJECT_TYPE, and the corresponding subobject types for them (for example, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER pairs with D3D12_RASTERIZER_DESC. In terms of alignment, the D3D12 runtime expects subobjects to be individual struct pairs of enum-struct, rather than a continuous set of fields. It also expects them to be aligned to the natural word alignment of the system. This can be achieved either usingalignas(void*), or making a union of the enum + subobject and a void*.
It isn’t sufficient to simply union the D3D12_PIPELINE_STATE_SUBOBJECT_TYPE with a void*, because this will result in certain subobjects being misaligned. For example, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY is followed by a D3D12_PRIMITIVE_TOPOLOGY_TYPE enum. If the subobject type is unioned with a void*, then there will be additional padding between these 2 members, resulting in corruption of the stream. Because of this, you should union the entire subobject struct with a void*, when
alignas is not availabled3dx12.h extensions for C++, which provide a set of helper structs for all pipeline subobjects (for example, the above struct is very similar to CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER). This header can be found under the DirectX-Headers repo on github.
-runtime-validation
The runtime will validate the PSO desc is either a compute, mesh, or graphics pipeline, that all subobjects are recognised types, and that there are not duplicate subobjects.Some subobjects are considered to be a “derived” version of others for the purposes of recognising duplicated subobjects. For example, if the runtime discovers a D3D12_DEPTH_STENCIL_DESC subobject, and then later a D3D12_DEPTH_STENCIL_DESC1, it will consider these duplicate subobjects and fail.
Requirements
Header: d3d12_xs.h or d3d12_x.hLibrary: d3d12_xs.lib or d3d12_x.lib
Supported Platforms: XBOX Series consoles and XBOX One family
