Changes

Jump to navigation Jump to search
401 bytes added ,  11:53, 24 August 2023
Line 663: Line 663:  
There are 3 address registers: a0.x, a0.y and aL (loop counter). For format 1 instructions, when IDX != 0, the value of the corresponding address register is added to SRC1's value. For example, if IDX = 2, a0.y = 3 and SRC1 = c8, then instead SRC1+a0.y = c11 will be used for the instruction. It is only possible to use address registers on constant registers, attempting to use them on input attribute or temporary registers results in the address register being ignored (i.e. read as zero).
 
There are 3 address registers: a0.x, a0.y and aL (loop counter). For format 1 instructions, when IDX != 0, the value of the corresponding address register is added to SRC1's value. For example, if IDX = 2, a0.y = 3 and SRC1 = c8, then instead SRC1+a0.y = c11 will be used for the instruction. It is only possible to use address registers on constant registers, attempting to use them on input attribute or temporary registers results in the address register being ignored (i.e. read as zero).
   −
a0.x and a0.y are set manually through the MOVA instruction by rounding a float value to integer precision. Hence, they may take negative values.
+
a0.x and a0.y are set manually through the MOVA instruction by rounding a float value to integer precision. Hence, they may take negative values. The way out-of-bounds values behave when reading uniforms is as follows:
 +
* If the value is out of byte bounds (less than -128 or greater than 127), the result is the vector (0, 0, 0, 0).
 +
* If the value without its sign bit (value & 0x7F) is greater than 95, the result is the vector (1, 1, 1, 1).
 +
* Otherwise, the index of the resulting uniform value is the value without its sign bit (value & 0x7F).
    
aL can only be set indirectly by the LOOP instruction. It is still accessible and valid after exiting a LOOP block, though.
 
aL can only be set indirectly by the LOOP instruction. It is still accessible and valid after exiting a LOOP block, though.
1,434

edits

Navigation menu