Microsoft DirectX 8.0 (Visual Basic)

Understanding the Pixel Shader Virtual Machine

The following diagram illustrates the logical flow of data through the pixel shader virtual machine.

The data that is interpolated per triangle is routed to the virtual machine as shown in the above diagram. The texture coordinates and color values are interpolated for each pixel. Note that the mapping of texture coordinates is controlled by setting the D3DTSS_TEXCOORDINDEX texture stage state. For example, the oD0 data output by the vertex shader would be iterated across a triangle, with the results at each individual pixel being set into the v0 register of the pixel shader.