GPU/Shader Instruction Set: Difference between revisions
Fix LOOP instruction: Number of iterations is actually given by INT.x directly |
Clean up register info |
||
Line 507: | Line 507: | ||
| 3 | | 3 | ||
| LOOP | | LOOP | ||
| Loops over the code between itself and DST (inclusive), performing INT.x+1 iterations in total. First, aL is initialized to INT.y. After each iteration, aL is incremented by INT.z. | | Loops over the code between itself and DST (inclusive), performing INT.x+1 iterations in total. First, aL is initialized to INT.y. After each iteration, aL is incremented by INT.z. | ||
|- | |- | ||
| 0x2A | | 0x2A | ||
Line 708: | Line 708: | ||
== Registers == | == Registers == | ||
Input attribute registers (v0-v7?) store the per-vertex data given by the CPU and hence are read-only. | |||
Output attribute registers (o0-o6) hold the data to be passed to the later GPU stages and are write-only. Each of the output attribute register components is assigned a semantic by setting the corresponding [[GPU_Internal_Registers]]. | |||
Uniform registers hold user-specified data which is constant throughout all processed vertices. There are 96 float[4] uniform registers (c0-c95), eight boolean registers (b0-b7), and four int[4] registers (i0-i3). | |||
Temporary ( | Temporary registers (r0-r15) can be used for intermediate calculations and can both be read and written. | ||
Many shader instructions which take float arguments have only 5 bits available for the second argument. They may hence only refer to input attributes or temporary registers. In particular, it's not possible to pass two float[4] uniforms to these instructions. | |||
It appears that writing twice to the same output register can cause problems (e.g. GPU hangs). | |||
It appears that writing twice to the same output register can cause problems | |||
DST mapping : | DST mapping : | ||
Line 761: | Line 757: | ||
| Vector uniform registers. | | Vector uniform registers. | ||
|} | |} | ||