loop - ps

Starts a loop...endloop - ps block.

Syntax

loop aL, i#

 

Where:

Remarks

Pixel shader versions1_11_21_31_42_02_x2_sw3_03_sw
loopxx

 

  • The Loop Counter Register (aL) holds the current loop count and can be used for relative addressing into Input Color Register (v#) inside the loop block.
  • i#.x specifies the iteration count. The legal range is [0, 255]. Note that this instruction does not increment or decrement the value of i#.x.
  • i#.y specifies the initial value of the Loop Counter Register (aL) register. The legal range is [0, 255]. Note that this instruction does not increment or decrement the value of i#.y.
  • i#.z specifies the step/stride size. The legal range is [-128, 127].
  • i#.w is not used by the loop block and has to be 0.
  • Loop blocks may be nested. See Flow Control Limitations.
  • When nested, the value of the Loop Counter Register (aL) refers to the immediate enclosing loop block.
  • Loop blocks are allowed to be either completely inside an if* block or completely surrounding it. No straddling is allowed.

Example



loop aL, i3
    add r1, r0, v2[ aL ]
endloop


 

 

Community Additions

ADD
Show:
© 2014 Microsoft