![]() |
![]() |
![]() |
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:
Name | Description | Instruction slots | Setup | Arithmetic | Flow control | New |
---|---|---|---|---|---|---|
abs | Absolute value | 1 | x | x | ||
add | Add two vectors | 1 | x | |||
call | Call a subroutine | 2 | x | x | ||
callnz bool | Call a subroutine if a Boolean register is not zero | 3 | x | x | ||
crs | Cross product | 2 | x | x | ||
dcl_usage input register - vs | Declare input vertex registers (see Registers - vs_2_0) | 0 | x | |||
def | Define constants | 0 | x | |||
defb | Define a Boolean constant | 0 | x | x | ||
defi | Define an integer constant | 0 | x | x | ||
dp3 | Three-component dot product | 1 | x | |||
dp4 | Four-component dot product | 1 | x | |||
dst | Calculate the distance vector | 1 | x | |||
else | Begin an else block | 1 | x | x | ||
endif | End an if bool...else block | 1 | x | x | ||
endloop | End of a loop block | 2 | x | x | ||
endrep | End of a repeat block | 2 | x | x | ||
exp | Full precision 2x | 1 | x | |||
expp | Partial precision 2x | 1 | x | |||
frc | Fractional component | 1 | x | |||
if bool | Begin an if bool block (using a Boolean condition) | 3 | x | x | ||
label | Label | 0 | x | x | ||
lit | Partial lighting calculation | 3 | x | |||
log | Full precision log2(x) | 1 | x | |||
logp | Partial precision log2(x) | 1 | x | |||
loop | Loop | 3 | x | x | ||
lrp | Linear interpolation | 2 | x | x | ||
m3x2 | 3x2 multiply | 2 | x | |||
m3x3 | 3x3 multiply | 3 | x | |||
m3x4 | 3x4 multiply | 4 | x | |||
m4x3 | 4x3 multiply | 3 | x | |||
m4x4 | 4x4 multiply | 4 | x | |||
mad | Multiply and add | 1 | x | |||
max | Maximum | 1 | x | |||
min | Minimum | 1 | x | |||
mov | Move | 1 | x | |||
mova | Move data from a floating-point register to the address register (a0) | 1 | x | x | ||
mul | Multiply | 1 | x | |||
nop | No operation | 1 | x | |||
nrm | Normalize a 4-D vector | 3 | x | x | ||
pow | xy | 3 | x | x | ||
rcp | Reciprocal | 1 | x | |||
rep | Repeat | 3 | x | x | ||
ret | End of either a subroutine or main | 1 | x | x | ||
rsq | Reciprocal square root | 1 | x | |||
sge | Greater than or equal compare | 1 | x | |||
sgn | Sign | 3 | x | x | ||
sincos | Sine and cosine | 8 | x | x | ||
slt | Less than compare | 1 | x | |||
sub | Subtract | 1 | x | |||
vs | Version | 0 | x |