Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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 slots - Number of instruction slots used by each instruction.
  • Setup - Non-arithmetic instructions. Every shader must have a version instruction and it must be the first instruction.
  • Arithmetic - These instructions provide the mathematical operations in a shader.
  • Flow control - These instructions add flow control capabilities such as loop - vs...endloop - vs, if bool - vs...else...endif, and subroutine calls.
  • New - These instructions are new to this version.

Instruction Set

NameDescriptionInstruction slotsSetupArithmeticFlow controlNew
abs - vs Absolute value1x
add - vs Add two vectors1x
break - vs Break out of a loop - vs...endloop - vs or rep...endrep block1xx
break_comp - vs Conditionally break out of a loop - vs...endloop - vs or rep...endrep block, with a comparison3xx
breakp - vs Break out of a loop - vs...endloop - vs or rep...endrep block, based on a predicate3xx
call - vs Call a subroutine2x
callnz bool - vs Call a subroutine if a Boolean register is not zero3x
callnz pred - vs Call a subroutine if a predicate register is not zero3xx
crs - vs Cross product2x
dcl_usage input (sm1, sm2, sm3 - vs asm) Declare input vertex registers (see Registers - vs_2_x)0x
def - vs Define constants0x
defb - vs Define a Boolean constant0x
defi - vs Define an integer constant0x
dp3 - vs Three-component dot product1x
dp4 - vs Four-component dot product1x
dst - vs Calculate the distance vector1x
else - vs Begin an else - vs block1x
endif - vs End an if bool - vs...else - vs block1x
endloop - vs End of a loop - vs block2x
endrep - vs End of a repeat block2x
exp - vs Full precision 2x1x
exp - vs Partial precision 2x1x
frc - vs Fractional component1x
if bool - vs Begin an if bool - vs block (using a Boolean condition)3x
if_comp - vs Begin an if bool - vs block, with a comparison3xx
if pred - vs Begin an if bool - vs block with a predicate condition3xx
label - vs Label0x
lit - vs Partial lighting calculation3x
log - vs Full precision log₂(x)1x
logp - vs Partial precision log₂(x)1x
loop - vs Loop3x
lrp - vs Linear interpolation2x
m3x2 - vs 3x2 multiply2x
m3x3 - vs 3x3 multiply3x
m3x4 - vs 3x4 multiply4x
m4x3 - vs 4x3 multiply3x
m4x4 - vs 4x4 multiply4x
mad - vs Multiply and add1x
max - vs Maximum1x
min - vs Minimum1x
mov - vs Move1x
mova - vs Move data from a floating-point register to the address register (a0)1x
mul - vs Multiply1x
nop - vs No operation1x
nrm - vs Normalize a 4D vector3x
pow - vs xy3x
rcp - vs Reciprocal1x
rep - vs Repeat3x
ret - vs End of either a subroutine or main1x
rsq - vs Reciprocal square root1x
setp_comp - vs Set the predicate register1xx
sge - vs Greater than or equal compare1x
sgn - vs Sign3x
sincos - vs Sine and cosine8x
slt - vs Less than compare1x
sub - vs Subtract1x
vs Version0x


Related topics

Vertex Shader Instructions



© 2017 Microsoft