Export (0) Print
Expand All
Expand Minimize

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]

 

ItemDescription

vN[.mask]

[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.

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:

  • 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 but with no perspective correction and centroid clamped when multisampling.

 

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 ShaderGeometry ShaderPixel Shader
xxx

 

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 ModelSupported
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

 

Related topics

Shader Model 4 Assembly (DirectX HLSL)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft