Temporary register (HLSL PS reference)

Pixel shader input temporary registers are used to hold intermediate results.


no declaration is required
Pixel shader versions 1_1 1_2 1_3 1_4 2_0 2_sw 2_x 3_0 3_sw
Temporary Register x x x x x


  • There are 12 pixel-shader temporary registers: r0 to r11.
  • These registers are used for storing intermediate results during computations.
  • If a temporary register uses components that are not defined in previous code, shader validation will fail.
  • These are at least floating-point precision.
  • A maximum of three can be used in a single instruction.