Changes

Jump to navigation Jump to search
More thorough behavior testing
Line 664: Line 664:     
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:
 
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 offset is out of byte bounds (less than -128 or greater than 127), the offset is not applied (treated as 0).
* If the value without its sign bit (value & 0x7F) is greater than 95, the result is the vector (1, 1, 1, 1).
+
* The offset is added to the constant register index and masked by 0x7F.
* Otherwise, the index of the resulting uniform value is the value without its sign bit (value & 0x7F).
+
* If the resulting index is greater than 95, the result is (1, 1, 1, 1).
 +
* Otherwise, the result is the value at the indexed constant register.
    
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