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

Instructions - vs_2_0


This section contains reference information for the vertex shader version 2_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 slotsSetupArithmeticFlow controlNew
absAbsolute value1xx
addAdd two vectors1x
callCall a subroutine2xx
callnz boolCall a subroutine if a Boolean register is not zero3xx
crsCross product2xx
dcl_usage input register - vsDeclare input vertex registers (see Registers - vs_2_0)0x
defDefine constants0x
defbDefine a Boolean constant0xx
defiDefine an integer constant0xx
dp3Three-component dot product1x
dp4Four-component dot product1x
dstCalculate the distance vector1x
elseBegin an else block1xx
endifEnd an if bool...else block1xx
endloopEnd of a loop block2xx
endrepEnd of a repeat block2xx
expFull precision 2x1x
exppPartial precision 2x1x
frcFractional component1x
if boolBegin an if bool block (using a Boolean condition)3xx
labelLabel0xx
litPartial lighting calculation3x
logFull precision log2(x)1x
logpPartial precision log2(x)1x
loopLoop3xx
lrpLinear interpolation2xx
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)1xx
mulMultiply1x
nopNo operation1x
nrmNormalize a 4-D vector3xx
powxy3xx
rcpReciprocal1x
repRepeat3xx
retEnd of either a subroutine or main1xx
rsqReciprocal square root1x
sgeGreater than or equal compare1x
sgnSign3xx
sincosSine and cosine8xx
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.