Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.67 KB

dx9-graphics-reference-asm-vs-registers-constant-integer.md

File metadata and controls

40 lines (28 loc) · 1.67 KB
title description ms.assetid ms.topic ms.date topic_type api_name api_type api_location
Constant Integer Register (HLSL VS reference)
Constant integer registers are used only by loop - vs and rep - vs.
da9916d4-655b-4c98-99a4-1abfa66459b5
article
05/31/2018
kbArticle

Constant Integer Register (HLSL VS reference)

Constant integer registers are used only by loop - vs and rep - vs.

They can be set using defi - vs or SetVertexShaderConstantI.

When used as an argument to the loop - vs instruction:

  • .x is the iteration count. (rep - vs uses only this component).
  • .y is the initial value for the loop counter.
  • .z is the increment step for the loop counter.

The behavior of shader constants has changed between Direct3D 8 and Direct3D 9.

  • For Direct3D 9, constants set with defx assign values to the shader constant space. The lifetime of a constant declared with defx is confined to the execution of that shader only. Conversely, constants set using the APIs SetXXXShaderConstantX initialize constants in global space. Constants in global space are not copied to local space (visible to the shader) until SetxxxShaderConstants is called.
  • For Direct3D 8, constants set with defx or the APIs both assign values to the shader constant space. Each time the shader is executed, the constants are used by the current shader regardless of the technique used to set them.

Related topics

Vertex Shader Registers