next up previous
Next: Texture Shader Up: Hardware Architecture Previous: Hardware Architecture

Vertex Shader

A vertex shader [12] is a small assembly-language program. When enabled, it replaces the transform- and lighting-computations of the fixed-function pipeline. A vertex shader operates on a single vertex at a time. It does not operate on primitives and is unable to generate new vertices. Frustum clipping, perspective divide and viewport transformation are left to fixed processing stages. The computation-model of vertex shaders is straightforward. For every vertex to be processed, the vertex shader executes its program. It has access to four different types of memory locations: the per-vertex data of an incoming vertex, constant memory, temporary registers, and per-vertex output-registers (Figure 1).

Figure 1: Vertex Program
\includegraphics[]{D:/Studium/Per-Pixel-Lighting/text_cescg/image/VertexProgramm.eps}
The basic data type is the quad-float vector. In order to deal with efficient scalar packing and extraction, the input vectors can have their components arbitrarily rearranged or replicated (swizzled), output writes have a component write mask. The instruction set can be divided into vector, scalar and miscellaneous operations. No branching, jumping or looping is supported to maintain pipeline efficiency. All instructions have the same latency, this limits the complexity of any instruction but improves programmability and simplifies the hardware.


next up previous
Next: Texture Shader Up: Hardware Architecture Previous: Hardware Architecture
Gerald Schröcker 2002-03-21