dcl_input (sm4 - asm)

Declares a shader-input register.

dcl_input vN[.mask][, interpolationMode]
Item Description
vN
[in] A vertex data register.
  • N is an integer that identifies the register number.
  • [.mask] is an optional component mask (.xyzw) that specifies which of the register components to use.
interpolationMode
[in] Optional. The interpolation mode, which is only honored on pixel shader input registers. It can be one of the following values:
  • constant - do not interpolate between register values.
  • linear - interpolate linearly between register values.
  • linearCentroid - same as linear but centroid clamped when multisampling.
  • linearNoperspective - same as linear but with no perspective correction.
  • linearNoperspectiveCentroid - same as linear, centroid clamped when multisampling, no perspective correction.

Interpolation Notes

By default, vertex attributes are interpolated from a pixel center when performing multisample antialiasing. If a pixel center is not covered, an attribute is extrapolated to a pixel center before interpolation.

For a pixel that is not fully covered or an attribute that does not cover a pixel center, you can specify centroid sampling which forces sampling to occur somewhere within the covered area of the pixel. Because a sample mask (if used) is applied before the centroid is computed, any sample location masked out by the sample mask cannot be chosen as a centroid location.

This instruction applies to the following shader stages:

Vertex Shader Geometry Shader Pixel Shader
x x x

To identify the input as a system value, use dcl_input_sv (sm4 - asm).

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.

dcl_input v3.xyz

dcl_input v0.x, linearCentroid

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

Shader Model 4 Assembly (DirectX HLSL)