Microsoft DirectX 8.0 (C++) |
The Direct3DX vertex shader assembler supports the following general instructions.
add | Sum |
dp3 | Three-components dot-product |
dp4 | Four-component dot-product |
dst | Distance vector |
expp | Exponential 10-bit precision |
lit | Lighting coefficients |
logp | Logarithm 10-bit precision |
mad | Multiply and add |
max | Maximum |
min | Minimum |
mov | Move |
mul | Multiply |
rcp | Reciprocal |
rsq | Reciprocal square root |
sge | Set on greater or equal than |
slt | Set on less than |
sub | Subtract |
Each source operand may be arbitrarily swizzled on read, including broadcast/replicate. Each source operand may be negated.
Writes to the destination registers can include masking of individual components; that is, only the specified components (x,y,z,or w) are updated. No swizzling or negation is supported on writes. Therefore, the output masks must be in the x, y, z, and w order.
The software emulated front end will use the masks on the output register writes to detect what parts of the output vertex a shader modifies and compute an output flexible vertex format (FVF) accordingly for submission to the hardware for rasterization-only use.
Note that unlike the pixel shader language, no linear interpolation blend instruction is supported in the vertex shader language, and that the dp3 operator does not automatically clamp negative results to 0.0.