GPU/Shader Instruction Set: Difference between revisions
Steveice10 (talk | contribs) |
Clarify LITP instruction |
||
(One intermediate revision by one other user not shown) | |||
Line 349: | Line 349: | ||
| 1u | | 1u | ||
| LITP | | LITP | ||
| | | Partial lighting computation, may be used in conjunction with EX2, LG2, etc to compute the vertex lighting coefficients. See the [https://msdn.microsoft.com/en-us/library/windows/desktop/bb174703.aspx Microsoft] and [https://registry.khronos.org/OpenGL/extensions/ARB/ARB_vertex_program.txt ARB] docs for more information on how to implement the full lit function; DST = {max(src.x, 0), max(min(src.y, 127.9961), -127.9961), 0, max(src.w, 0)} and it sets the cmp.x and cmp.y flags based on if the respective src.x and src.w components are >= 0. | ||
|- | |- | ||
| 0x08 | | 0x08 | ||
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 | * 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 | * The offset is added to the constant register index and masked by 0x7F. | ||
* Otherwise, the | * 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. |