Microsoft DirectX 8.0 (C++)

Creating a Vertex Shader

A vertex shader is defined by two token arrays that specify the declaration and function of the shader. The token arrays are composed of single or multiple DWORD tokens terminated by an 0xFFFFFFFF token value.

The shader declaration defines the static external interface of the shader, including binding of stream data to vertex register inputs and values loaded into the shader constant memory. The shader function defines the operation of the shader as an array of instructions. These instructions are executed in order for each vertex that is processed during the time that the shader is bound to a device. Shaders created without a function array apply the fixed-function vertex processing when that shader is current.

The IDirect3DDevice8::CreateVertexShader method is used to create a vertex shader in Microsoft® DirectX® 8.0. You pass a declaration that defines the parallel DMA streams used and the function that defines the blending operations. Direct3D returns a shader handle. The shader validation is done when CreateVertexShader is called.