ID3D11DeviceContextX::SetShaderUserData Method

Sets shader user data registers by hardware shader stage.

Syntax

public:
void SetShaderUserData(
         D3D11X_HW_STAGE ShaderStage,
         UINT StartSlot,
         UINT NumRegisters,
         const UINT *pData
)  

Parameters

ShaderStage
Type: D3D11X_HW_STAGE 

[in] The hardware shader stage where the shader user data will be set, as a D3D11X_HW_STAGE enumeration constant, such as D3D11X_HW_STAGE_VS. See Shaders and the FXC Shader Compiler.

StartSlot
Type: UINT 

[in] The starting shader user data register slot to set.

This number ranges from 0 to 15. The hardware supports up to 16 shader user data inputs. The first two shader user data inputs (0 and 1) are used by the Xbox Shader ABI for Hull, Domain, Geometry, Pixel, and Compute shader stages. The first four shader user data inputs (0, 1, 2, and 3) are used by the Vertex Shader stage (D3D11X_HW_STAGE_VS, D3D11X_HW_STAGE_ES, D3D11X_HW_STAGE_LS).

For most usage scenarios, you will want to pick registers which do not conflict with the registers that are already in use by the Xbox Shader ABI (Application Binary Interface). Registers 4-15 are a safe choice.

NumRegisters
Type: UINT 

[in] The number of shader user data registers to set.

This number ranges from 1 to (16 – StartSlot).

pData
Type: UINT *

[in] An array of the data to set.

Return value

None.

Remarks

The shader user data can be read using the __XB_GetShaderUserData HLSL intrinsic.

SetShaderUserData is identical to the [x]SSetShaderUserData family of APIs, such as VSSetShaderUserData; however, SetShaderUserData uses the hardware shader stages directly. It is the developer’s responsibility to ensure that the correct hardware shader stage is selected that corresponds to the combination of shaders being used.

The [x]SSetShaderUserData APIs are the following methods:

Requirements

Header: Declared in d3d11_x.h.

Library: Use d3d11_x.lib.

See also

Reference

ID3D11DeviceContextX Interface

ID3D11DeviceContextX Members