Microsoft DirectX 9.0 |
Pixel shaders depend on registers to get vertex data, to output pixel data to the rasterizer, to hold temporary results during calculations and to identify texture sampling stages. There are several types of registers, each with a unique functionality. This section contains reference information for the input and output registers implemented by pixel shader version 2_x.
There is one additional register introduced in this version. It is used for predication.
Name | Register type | Count | R/W | # Read ports | # Reads/inst | Dimension | RelAddr | Defaults | Requires DCL |
---|---|---|---|---|---|---|---|---|---|
v# | Color Register | 2 | R | 1 | Unlimited | 4 | N | Partial(0001) | N |
r# | Temporary Register | 32 | R/W | 3 | Unlimited | 4 | N | None | N |
c# | Constant Float Register | 224 | R | 1 | Unlimited | 4 | N | 0000 | N |
i# | Constant Integer Register | 16 | R | 1 | 1 | 4 | N | 0000 | N |
b# | Constant Boolean Register | 16 | R | 1 | 1 | 1 | N | FALSE | N |
p | Predicate | 1 | R | 1 | 1 | 1 | N | None | Y |
s# | Sampler Register | 16 | R | 1 | 1 | 4 | N | Depends* | Y |
t# | Input Texture Coordinate Register | 8 | R | 1 | 1 | 1 | N | None | Y |
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
Name | Register type | Count | R/W | # Read ports | # Reads/inst | Dimension | RelAddr | Defaults | Requires DCL |
---|---|---|---|---|---|---|---|---|---|
oC# | Output Color Register | See Multielement Texture | w | 0 | 0 | 4 | N | None | N |
oDepth | Output Depth Register | 1 | W | 0 | 0 | 1 | N | None | N |
Where: