| ?/TD> |
| Microsoft DirectX 9.0 |
This section contains reference information for the pixel shader version 1_X instructions.
There are several types of pixel shader instructions, as shown in the following table.
| Version | Instruction slots | 1_1 | 1_2 | 1_3 | 1_4 | |
|---|---|---|---|---|---|---|
| ps | Version number | 0 | x | x | x | x |
| Constant instructions | 1_1 | 1_2 | 1_3 | 1_4 | ||
| def | Define constants | 0 | x | x | x | x |
| Phase instructions | 1_1 | 1_2 | 1_3 | 1_4 | ||
| phase | Transition between phase 1 and phase 2 | 0 | x | |||
| Arithmetic instructions | 1_1 | 1_2 | 1_3 | 1_4 | ||
| add | Add two vectors | 1 | x | x | x | x |
| bem | Apply a fake bump environment-map transform | 2 | x | |||
| cmp | Compare source to 0 | 1 | x | x | x | |
| cnd | Compare source to 0.5 | 1 | x | x | x | x |
| dp3 | Three-component dot product | 1 | x | x | x | x |
| dp4 | Four-component dot product | 1 | x | x | x | |
| lrp | Linear interpolate | 1 | x | x | x | x |
| mad | Multiply and add | 1 | x | x | x | x |
| mov | Move | 1 | x | x | x | x |
| mul | Multiply | 1 | x | x | x | x |
| nop | No operation | 0 | x | x | x | x |
| sub | Subtract | 1 | x | x | x | x |
| Texture instructions | 1_1 | 1_2 | 1_3 | 1_4 | ||
| tex | Sample a texture | 1 | x | x | x | |
| texbem | Apply a fake bump environment-map transform | 1 | x | x | x | |
| texbeml | Apply a fake bump environment-map transform with luminance correction | 1+1 | x | x | x | |
| texcoord | Interpret texture coordinate data as color data | 1 | x | x | x | |
| texcrd | Copy texture coordinate data as color data | 1 | x | |||
| texdepth | Calculate depth values | 1 | x | |||
| texdp3 | Three-component dot product between texture data and the texture coordinates | 1 | x | x | ||
| texdp3tex | Three-component dot product and 1-D texture lookup | 1 | x | x | ||
| texkill | Cancels rendering of pixels based on a comparison | 1 | x | x | x | x |
| texld | Sample a texture | 1 | x | |||
| texm3x2depth | Calculate per-pixel depth values | 1 | x | |||
| texm3x2pad | First row matrix multiply of a two-row matrix multiply | 1 | x | x | x | |
| texm3x2tex | Final row matrix multiply of a two-row matrix multiply | 1 | x | x | x | |
| texm3x3 | 3x3 matrix multiply | 1 | x | x | ||
| texm3x3pad | First or second row multiply of a three-row matrix multiply | 1 | x | x | x | |
| texm3x3spec | Final row multiply of a three-row matrix multiply | 1 | x | x | x | |
| texm3x3tex | Texture look up using a 3x3 matrix multiply | 1 | x | x | x | |
| texm3x3vspec | Texture look up using a 3x3 matrix multiply, with non-constant eye-ray vector | 1 | x | x | x | |
| texreg2ar | Sample a texture using the alpha and red components | 1 | x | x | x | |
| texreg2gb | Sample a texture using the green and blue components | 1 | x | x | x | |
| texreg2rgb | Sample a texture using the red, green and blue components | 1 | x | x | ||
Where 1 + 1 counts as 1 arithmetic instruction + 1 texture instruction.