loop (Vertex Shader)
Starts a loop...endloop block.
Syntax
Where:
- aL is the Loop Counter Register, holding the current loop count.
- integerRegister is an input source register. integerRegister.x specifies the iteration count, integerRegister.y specifies the initial value of the current loop counter register, and integerRegister.z specifies the increment for the current loop counter register.
Remarks
Vertex shader versions | 1_1 | 2_0 | 2_x | 2_sw | 3_0 | 3_sw |
---|
loop | | x | x | x | x | x |
---|
loop starts a loop...endloop block. Only integer registers can be used in this instruction The loop instruction is provided for iteration, and supports an auto-incremented loop counter register that can be used to index the constant array. When nested, any time the loop counter register is used, it refers to the current loop.
This instruction works as shown here.
StartLoopOffset = next instruction offset
LoopCounter = IntegerReg.x
IterationCount = IntegerReg.y
LoopStep = InteferReg.z
if (IterationCounter <= 0)
Continue execution after the next EndLoop instruction
- The endloop instruction must follow the last instruction of a loop block.
- The endloop instruction offset must be greater than the corresponding loop instruction offset.
- Loops cannot be nested in version vs_2_0. Versions vs_2_x and above support nesting.
- Loops are allowed to be either completely inside an if block or completely surrounding it; no straddling is allowed.
- The maximum loop initial value (base offset) is 255.
- The maximum loop iteration count is 255.
- The maximum step/stride size is 127 as signed strides, for example, -128 are supported.
- The loop initial value and loop iteration count cannot be negative.
Instruction Information
Minimum operating system | Windows 98 |
---|