ps_2_0 Instructions

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:

  • Instruction slots - Number of instruction slots used by each instruction.
  • Setup - A pixel shader must have a version instruction and it must be the first instruction.
  • Arithmetic - These instructions provide the mathematical operations in a shader.
  • Texture - These instructions are used to load and sample texture data, and to modify texture coordinates.
  • New - These instructions are new to this version.

Instruction Set

NameDescriptionInstruction slotsSetupArithmeticTextureNew
abs - ps Absolute value1xx
add - ps Add two vectors1x
cmp - ps Compare source to 01x
crs - ps Cross product2xx
dcl_samplerType (sm2, sm3 - ps asm) Declare the texture dimension for a sampler0xx
dcl - (sm2, sm3 - ps asm) Declare the association between vertex shader output registers and pixel shader input registers.0xx
def - ps Define constants0x
dp2add - ps 2D dot product and add2xx
dp3 - ps 3D dot product1x
dp4 - ps 4D dot product1x
exp - ps Full precision 2x1xx
frc - ps Fractional component1xx
log - ps Full precision log₂(x)1xx
lrp - ps Linear interpolate2x
m3x2 - ps 3x2 multiply2xx
m3x3 - ps 3x3 multiply3xx
m3x4 - ps 3x4 multiply4xx
m4x3 - ps 4x3 multiply3xx
m4x4 - ps 4x4 multiply4xx
mad - ps Multiply and add1x
max - ps Maximum1xx
min - ps Minimum1xx
mov - ps Move1x
mul - ps Multiply1x
nop - ps No operation1x
nrm - ps Normalize3xx
pow - ps xy3xx
ps Version0x
rcp - ps Reciprocal1xx
rsq - ps Reciprocal square root1xx
sincos - ps Sine and cosine8xx
sub - ps Subtract1x
texkill - ps Kill pixel render1x
texld - ps_2_0 and up Sample a texture1xx
texldb - ps Texture sampling with level-of-detail bias from w-component1xx
texldp - ps Texture sampling with projective divide by w-component1xx


Related topics

Pixel Shader Instructions