dcl_input_sv (sm4 - asm)
Declares a shader-input register that expects a system-value to be provided from a preceding stage.
dcl_input_sv vN[.mask], systemValueName[, interpolationMode] |
---|
Item | Description |
---|---|
vN |
[in] A vertex data register.
|
systemValueName |
[in] The system-value name which is a string (see system-value semantics) without the "SV_" prefix. |
interpolationMode |
[in] Optional. The interpolation mode which affects how values are calculated during rasterization; the mode is only used by a pixel shader. It can be one of the following values:
|
A component mask for a system-value declaration can be any appropriate subset of [xyzw]; declarations may not overlap (each declaration must follow the sequence xyzw). When declaring scalar system values (clip distance and cull distance for example), you can declare multiple system values in a single register. If you do so, make sure other modifiers like the interpolation modes match.
This instruction applies to the following shader stages:
Vertex Shader | Geometry Shader | Pixel Shader |
---|---|---|
x | x | x |
This instruction is included to aid in debugging a shader in assembly; you cannot author a shader in assembly language using Shader Model 4.
Example
Here are some examples:
// valid
dcl_input v0.y, linear
dcl_input_sv v0.w, clipDistance
dcl_input_sv v0.z, cullDistance
// invalid declarations
dcl_input v0.y, linear
dcl_input_sv v0.x, clipDistance // the y component was previously declared, this declaration must use
// either the z or w component
dcl_input v0.y, linearNoPerspective // the interpolation mode is linear-no-perspective
dcl_input_sv v0.z, renderTargetArrayIndex, constant // the interpolation modes is constant
// the interpolation modes must match
Minimum Shader Model
This function is supported in the following shader models.
Shader Model | Supported |
---|---|
Shader Model 5 | yes |
Shader Model 4.1 | yes |
Shader Model 4 | yes |
Shader Model 3 (DirectX HLSL) | no |
Shader Model 2 (DirectX HLSL) | no |
Shader Model 1 (DirectX HLSL) | no |