?/TD> |
Microsoft DirectX 9.0 |
This section contains reference information for the input and output registers implemented by vertex shader version 2_x. Vector elements are designated as x, y, z, w (or the r, g, b, a equivalents).
Name | Register type | Count | Data type | Dimension | I/O permissions | Read port | Read / Instruction | Rel-Address | Defaults | Requires DCL |
---|---|---|---|---|---|---|---|---|---|---|
v# | Input Register | 16 | floating-point | 4-D vector | read | 1 | 3 | no | Partial(0001) | yes |
r# | Temporary Register | 12 (1) | floating-point | 4-D vector | read / write | 3 | 3 | no | none | no |
c# | Constant Float Register | 256 (2) | floating-point | 4-D vector | define / read | 1 | 2 | a0 / aL | (0, 0, 0, 0) | no |
i# | Constant Integer Register | 16 | integer | 4-D vector | define / use | 1 | 1 | no | (0, 0, 0, 0) | no |
b# | Constant Boolean Register | 16 | boolean | scalar | define / use | 1 | 1 | no | FALSE | no |
a0 | Address Register | 1 | integer | 4-D vector | write / use | 1 | 2 | no | none | no |
aL | Loop Counter Register | 1 | integer | scalar | use | 1 | 2 | no | none | no |
p0 | Predicate | 1 | boolean | 4-D vector | write / use | 1 | 1 | no | none | no |
Where:
mad r0, c0, c0, c1 mad r0, c2, t1, c1 mad r0, c3, c3, c3
But the following is illegal because it uses mnore than 2 unique constant registers:
mad r0, c1, c2, c3
(1) - 12 is the minimum r# register counted required by vs_2_x. The D3DCAPS9.VS20Caps.NumTemps cap contains the actual r# register count supported by the device. See D3DCAPS9.
(2) - 256 is the minimum c# register count required by vs_2_x. The MaxVertexShaderConst cap contains the actual c# register count supported by the device. See D3DCAPS9.
Name | Register type | Count | Data type | Dimension | I/O permissions | Rel-Address | Default | Require DCL |
---|---|---|---|---|---|---|---|---|
oD# | Diffuse/Specular Register | 2 (3) | floating-point | 4-D vector | write | no | none | no |
oFog | Fog Register | 1 | floating-point | scalar | write | no | none | no |
oPos (4) | Position Register | 1 | floating-point | 4-D vector | write | no | none | no |
oPts | Point Size Register | 1 | floating-point | scalar | write | no | none | no |
oT# | Texture Coordinates Register | 8 | floating-point | 4-D vector | write | no | none | no |
(3) oD0 = diffuse color; oD1 = specular color.
(4) All four components of oPos must be written.