ps_3_0 Instructions
Microsoft DirectX 9.0 SDK Update (October 2004)

ps_3_0 Instructions


This section contains reference information for the pixel shader version 3_0 instructions.

There are several types of pixel shader instructions, as shown in the table. Columns to the right mean the following:

Instruction Set

NameDescriptionInstruction slotsSetupArithmeticTextureFlow controlNew
absAbsolute value1x
addAdd two vectors1x
breakBreak out of a loop...endloop or rep...endrep block1x
break_compConditionally break out of a loop...endloop or rep...endrep block, with a comparison3x
breakpBreak out of a loop...endloop or rep...endrep block, based on a predicate3x
callCall a subroutine2x
callnz boolCall a subroutine if a boolean register is not zero3x
callnz predCall a subroutine if a predicate register is not zero3x
cmpCompare source to 01x
crsCross product2x
dcl_samplerTypeDeclare the texture dimension for a sampler0x
dcl_usageDeclare input and output registers0xx
defDefine constants0x
defbDefine a Boolean constant0x
defiDefine an integer constant0x
dp2add2-D dot product and add2x
dp33-D dot product1x
dp44-D dot product1x
dsxRate of change in the x-direction2x
dsyRate of change in the y direction2x
elseBegin an else block1x
endifEnd an if...else block1x
endloopendloop2xx
endrepEnd of a repeat block2x
expFull precision 2x1x
frcFractional component1x
if boolBegin an if block3x
if_compBegin an if block with a comparison3x
if predBegin an if block with predication3x
labelLabel0x
logFull precision log2(x)1x
loopLoop3xx
lrpLinear interpolate2x
m3x23x2 multiply2x
m3x33x3 multiply3x
m3x43x4 multiply4x
m4x34x3 multiply3x
m4x44x4 multiply4x
madMultiply and add1x
maxMaximum1x
minMinimum1x
movMove1x
mulMultiply1x
nopNo operation1x
nrmNormalize3x
powxy3x
psVersion0x
rcpReciprocal1x
repRepeat3x
retEnd of a subroutine1x
rsqReciprocal square root1x
setp_compSet the predicate register1x
sincosSine and cosine8x
subSubtract1x
texkillKill pixel render2x
texldSample a textureSee note 1x
texldbTexture sampling with level of detail (LOD) bias from w-component6x
texldlTexture sampling with LOD from w-componentSee note 2xx
texlddTexture sampling with user-provided gradients3x
texldpTexture sampling with projective divide by w-componentSee note 3x

Notes:

  1. If the texture is a cube map, slots = 4; otherwise slots = 1.
  2. If the texture is a cube map, slots = 5; otherwise slots = 2.
  3. If the texture is a cube map, slots = 4; otherwise slots = 3.


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.