![]() |
![]() |
![]() |
This section contains reference information for the pixel shader version 2_0 instructions.
There are several types of pixel shader instructions, as shown in the table. Columns to the right mean the following:
Name | Description | Instruction slots | Setup | Arithmetic | Texture | New |
---|---|---|---|---|---|---|
abs | Absolute value | 1 | x | x | ||
add | Add two vectors | 1 | x | |||
cmp | Compare source to 0 | 1 | x | |||
crs | Cross product | 2 | x | x | ||
dcl_samplerType | Declare the texture dimension for a sampler | 0 | x | x | ||
dcl | Declare the association between vertex shader output registers and pixel shader input registers. | 0 | x | x | ||
def | Define constants | 0 | x | |||
dp2add | 2-D dot product and add | 2 | x | x | ||
dp3 | 3-D dot product | 1 | x | |||
dp4 | 4-D dot product | 1 | x | |||
exp | Full precision 2x | 1 | x | x | ||
frc | Fractional component | 1 | x | x | ||
log | Full precision log2(x) | 1 | x | x | ||
lrp | Linear interpolate | 2 | x | |||
m3x2 | 3x2 multiply | 2 | x | x | ||
m3x3 | 3x3 multiply | 3 | x | x | ||
m3x4 | 3x4 multiply | 4 | x | x | ||
m4x3 | 4x3 multiply | 3 | x | x | ||
m4x4 | 4x4 multiply | 4 | x | x | ||
mad | Multiply and add | 1 | x | |||
max | Maximum | 1 | x | x | ||
min | Minimum | 1 | x | x | ||
mov | Move | 1 | x | |||
mul | Multiply | 1 | x | |||
nop | No operation | 1 | x | |||
nrm | Normalize | 3 | x | x | ||
pow | xy | 3 | x | x | ||
ps | Version | 0 | x | |||
rcp | Reciprocal | 1 | x | x | ||
rsq | Reciprocal square root | 1 | x | x | ||
sincos | Sine and cosine | 8 | x | x | ||
sub | Subtract | 1 | x | |||
texkill | Kill pixel render | 1 | x | |||
texld | Sample a texture | 1 | x | x | ||
texldb | Texture sampling with level of detail (LOD) bias from w-component | 1 | x | x | ||
texldp | Texture sampling with projective divide by w-component | 1 | x | x |