#
Instructions - vs_1_1

This section contains reference information for the vertex shader version 1_1 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.
- Macro-ops - These instructions combine arithmetic instructions to provide higher level functionality. The use of macro-ops is optional. It is preferable to use macro-ops, especially the matrix multiply instructions (m3x2, m3x3, m3x4, m4x3, m4x4), because they provide optimization opportunities to the underlying implementation.
- New - These instructions are new to this version.

## Instruction Set

Name | Description | Instruction slots | Setup | Arithmetic | Macro-ops | New |
---|

add | Add two vectors | 1 | | x | | x |

dcl_usage | Declare input vertex registers. See Registers - vs_1_1 | 0 | x | | | x |

def | Define constants | 0 | x | | | x |

dp3 | Three-component dot product | 1 | | x | | x |

dp4 | Three-component dot product | 1 | | x | | x |

dst | Distance | 1 | | x | | x |

exp | Full precision 2^{x} | 10 | | | x | x |

expp | Partial precision 2^{x} | 1 | | | x | x |

frc | Fractional component | 3 | | | x | x |

lit | Calculate lighting | 1 | | x | | x |

log | Full precision log_{2}(x) | 10 | | | x | x |

logp | Partial precision log_{2}(x) | 1 | | | x | x |

m3x2 | 3x2 matrix multiply | 2 | | | x | x |

m3x3 | 3x3 matrix multiply | 3 | | | x | x |

m3x4 | 3x4 matrix multiply | 4 | | | x | x |

m4x3 | 4x3 matrix multiply | 3 | | | x | x |

m4x4 | 4x4 matrix multiply | 4 | | | x | x |

mad | Multiply and add | 1 | | x | | x |

max | Maximum | 1 | | x | | x |

min | Minimum | 1 | | x | | x |

mov | Move | 1 | | x | | x |

mul | Multiply | 1 | | x | | x |

nop | No operation | 0 | | x | | x |

rcp | Reciprocal | 1 | | x | | x |

rsq | Reciprocal square root | 1 | | x | | x |

sge | Greater than or equal compare | 1 | | x | | x |

slt | Less than compare | 1 | | x | | x |

sub | Subtract | 1 | | x | | x |

vs | Version | 0 | x | | | x |