| Microsoft DirectX 8.1 (pixel shader versions 1.0, 1.1, 1.2, 1.3, 1.4) |
Instructions
Pixel shaders contain the following types of instructions.
- A Version instruction defines the shader version. There is only one version instruction in a shader and it is the first instruction in a shader.
- Constant instructions define constants. These instructions must be after the version instruction and before any arithmetic or texture address instructions.
- A Phase instruction splits a shader into two sections: phase 1 and phase 2. Each phase has separate arithmetic and texture address instruction limits. Version 1.4 is the only version that supports the phase instruction.
- Arithmetic instructions include common mathematical operations such as add and subtract, multiply, and taking a dot product.
- Texture Address instructions manipulate texture coordinate data that is associated with texture stages.
The instructions are listed below.
| Version instructions | Version | ||||
|---|---|---|---|---|---|
| 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | |
| ps | x | x | x | x | x |
| Constant instructions | Version | ||||
| 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | |
| def | x | x | x | x | x |
| Phase instructions | Version | ||||
| 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | |
| phase | x | ||||
| Arithmetic instructions | Version | ||||
| 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | |
| add | x | x | x | x | x |
| bem | x | ||||
| cmp | x | x | x | ||
| cnd | x | x | x | x | x |
| dp3 | x | x | x | x | x |
| dp4 | x | x | x | ||
| lrp | x | x | x | x | x |
| mad | x | x | x | x | x |
| mov | x | x | x | x | x |
| mul | x | x | x | x | x |
| nop | x | x | x | x | x |
| sub | x | x | x | x | x |
| Texture address instructions | Version | ||||
| 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | |
| tex | x | x | x | x | |
| texbem | x | x | x | x | |
| texbeml | x | x | x | x | |
| texcoord | x | x | x | x | |
| texcrd | x | ||||
| texdepth | x | ||||
| texdp3 | x | x | |||
| texdp3tex | x | x | |||
| texkill | x | x | x | x | x |
| texld | x | ||||
| texm3x2depth | x | ||||
| texm3x2pad | x | x | x | x | |
| texm3x2tex | x | x | x | x | |
| texm3x3 | x | x | |||
| texm3x3pad | x | x | x | x | |
| texm3x3tex | x | x | x | x | |
| texm3x3spec | x | x | x | x | |
| texm3x3vspec | x | x | x | x | |
| texreg2ar | x | x | x | x | |
| texreg2gb | x | x | x | x | |
| texreg2rgb | x | x | |||