Information
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_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 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.
  • Texture - These instructions support texture address lookup.
  • Flow control - These instructions add flow control such as loops, repeats, and if bool - vs...else...endif comparisons.
  • New - These instructions are new to this version.

Instruction Set

NameDescriptionInstruction slotsSetupArithmeticTextureFlow controlNew
abs - vs Absolute value1x
add - vs Add two vectors1x
break - vs Break out of a loop - vs...endloop - vs or rep...endrep block1x
break_comp - vs Conditionally break out of a loop - vs...endloop - vs or rep...endrep block, with a comparison3x
breakp - vs Break out of a loop - vs...endloop - vs or rep...endrep block, based on a predicate3x
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 zero3x
crs - vs Cross product2x
dcl_usage input (sm1, sm2, sm3 - vs asm) Declare input vertex registers (see Registers - vs_3_0)0x
dcl_samplerType (sm3 - vs asm) Declare the texture dimension for a sampler0xx
def - vs Define constants0x
defb - vs Declare a Boolean constant0x
defi - vs Declare an integer constant0x
dp3 - vs Three-component dot product1x
dp4 - vs Four-component dot product1x
dst - vs Distance1x
else - vs Begin an else block1x
endif - vs End an if bool - vs...else 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 comparison3x
if pred - vs Begin an if bool - vs block with a predicate condition3x
label - vs Label0x
lit - vs Calculate lighting3x
log - vs Full precision log2(x)1x
logp - vs Partial precision log2(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 an integer register1x
mul - vs Multiply1x
nop - vs No operation1x
nrm - vs Normalize3x
pow - vs xy3x
rcp - vs Reciprocal1x
rep - vs Repeat3x
ret - vs End of a subroutine1x
rsq - vs Reciprocal square root1x
setp_comp - vs Set the predicate register1x
sge - vs Greater than or equal compare1x
sgn - vs Sign3x
sincos - vs Sine and cosine8x
slt - vs Less than compare1x
sub - vs Subtract1x
texldl - vs Texture load with user-adjustable level-of-detailSee note 1xx
vs Version0x

 

Notes:

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

 

 

Community Additions

Show:
© 2014 Microsoft