ID3D12Device7::AddToStateObject method (d3d12.h)

Incrementally add to an existing state object. This incurs lower CPU overhead than creating a state object from scratch that is a superset of an existing one (for example, adding a few more shaders).

Syntax

HRESULT AddToStateObject(
  const D3D12_STATE_OBJECT_DESC *pAddition,
  ID3D12StateObject             *pStateObjectToGrowFrom,
  REFIID                        riid,
  void                          **ppNewStateObject
);

Parameters

pAddition

Type: _In_ const D3D12_STATE_OBJECT_DESC*

Description of state object contents to add to existing state object. To help generate this see the CD3D12_STATE_OBJECT_DESC helper in class in d3dx12.h.

pStateObjectToGrowFrom

Type: _In_ ID3D12StateObject*

Existing state object, which can be in use (for example, active raytracing) during this operation.

The existing state object must not be of type Collection.

riid

Type: _In_ REFIID

Must be the IID of the ID3D12StateObject interface.

ppNewStateObject

Type: _COM_Outptr_ void**

Returned state object.

Behavior is undefined if shader identifiers are retrieved for new shaders from this call and they are accessed via shader tables by any already existing or in-flight command list that references some older state object. Use of the new shaders added to the state object can occur only from commands (such as DispatchRays or ExecuteIndirect calls) recorded in a command list after the call to AddToStateObject.

Return value

S_OK for success. E_INVALIDARG, E_OUTOFMEMORY on failure. The debug layer provides detailed status information.

Remarks

For more info, see AddToStateObject.

Requirements

Requirement Value
Minimum supported client Windows 10 Build 20348
Minimum supported server Windows 10 Build 20348
Header d3d12.h
Library d3d12.lib
DLL d3d12.dll