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

Instructions - vs_2_x


This section contains reference information for the vertex shader version 2_x instructions.

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

Instruction Set

NameDescriptionInstruction slotsSetupArithmeticFlow controlNew
absAbsolute value1x
addAdd two vectors1x
breakBreak out of a loop...endloop or rep...endrep block1xx
break_compConditionally break out of a loop...endloop or rep...endrep block, with a comparison3xx
breakpBreak out of a loop...endloop or rep...endrep block, based on a predicate3xx
callCall a subroutine2x
callnz boolCall a subroutine if a Boolean register is not zero3x
callnz predCall a subroutine if a predicate register is not zero3xx
crsCross product2x
dcl_usage input register - vsDeclare input vertex registers (see Registers - vs_2_x)0x
defDefine constants0x
defbDefine a Boolean constant0x
defiDefine an integer constant0x
dp3Three-component dot product1x
dp4Four-component dot product1x
dstCalculate the distance vector1x
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 comparison3xx
if predBegin an if bool block with a predicate condition3xx
labelLabel0x
litPartial lighting calculation3x
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 the address register (a0)1x
mulMultiply1x
nopNo operation1x
nrmNormalize a 4-D vector3x
powxy3x
rcpReciprocal1x
repRepeat3x
retEnd of either a subroutine or main1x
rsqReciprocal square root1x
setp_compSet the predicate register1xx
sgeGreater than or equal compare1x
sgnSign3x
sincosSine and cosine8x
sltLess than compare1x
subSubtract1x
vsVersion0x


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