GPU/Shader Instruction Set: Difference between revisions
→Instructions: SETINDEX ! |
indices ! |
||
Line 299: | Line 299: | ||
The component selector enables swizzling. For example, component selector 0x1B is equivalent to .xyzw, while 0x55 is equivalent to .yyyy. | The component selector enables swizzling. For example, component selector 0x1B is equivalent to .xyzw, while 0x55 is equivalent to .yyyy. | ||
== Relative addressing == | |||
There are 3 global index registers : idx1, idx2 and idx3 = lcnt (loop counter). For format 1 instructions, when IDX != 0, the value of the corresponding index is added to SRC1's value. | |||
For example, if IDX = 2, idx2 = 3 and SRC1 = c8, then instead SRC1+idx3 = c11 will be used for the instruction. | |||
idx1 and idx2 can be set manually through the SETINDEX instruction. lcnt is set automatically by the LOOP instruction. Note that lcnt is still accessible and valid after exiting a LOOP block. | |||
== Registers == | == Registers == |