Instructions - vs_3_0
Microsoft DirectX 9.0 SDK Update (October 2004)

Instructions - vs_3_0


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

There are several types of vertex 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
crsCross product2x
dcl_usage outut register - vsDeclare input vertex registers (see Registers - vs_3_0)0x
dcl_samplerTypeDeclare the texture dimension for a sampler0xx
defDefine constants0x
defbDeclare a Boolean constant0x
defiDeclare an integer constant0x
dp3Three-component dot product1x
dp4Four-component dot product1x
dstDistance1x
elseBegin an else block1x
endifEnd an if bool...else block1x
endloopEnd of a loop block2x
endrepEnd of a repeat block2x
expFull precision 2x1x
exppPartial precision 2x1x
frcFractional component1x
if boolBegin an if bool block (using a Boolean condition)3x
if_compBegin an if bool block, with a comparison3x
if predBegin an if bool block with a predicate condition3x
labelLabel0x
litCalculate lighting3x
logFull precision log2(x)1x
logpPartial precision log2(x)1x
loopLoop3x
lrpLinear interpolation2x
m3x23x2 multiply2x
m3x33x3 multiply3x
m3x43x4 multiply4x
m4x34x3 multiply3x
m4x44x4 multiply4x
madMultiply and add1x
maxMaximum1x
minMinimum1x
movMove1x
movaMove data from a floating point register to an integer register1x
mulMultiply1x
nopNo operation1x
nrmNormalize3x
powxy3x
rcpReciprocal1x
repRepeat3x
retEnd of a subroutine1x
rsqReciprocal square root1x
setp_compSet the predicate register1x
sgeGreater than or equal compare1x
sgnSign3x
sincosSine and cosine8x
sltLess than compare1x
subSubtract1x
texldlTexture load with user-adjustable level of detail (LOD)See note 1xx
vsVersion0x

Notes:

  1. if the texture is a cube map, slots = 5; otherwise slots = 2


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