Direct3D Driver Shader Codes

This section describes the tokens that comprise pixel and vertex shader codes and how those tokens are formatted within an individual shader code. Pixel shader code follows the D3DHAL_DP2CREATEPIXELSHADER structure in the command stream. For DirectX 8.1 and earlier, vertex shader code follows the D3DHAL_DP2CREATEVERTEXSHADER structure. For DirectX 9.0 and later, vertex shader code follows the D3DHAL_DP2CREATEVERTEXSHADERFUNC structure. The runtime creates either a pixel or vertex shader when it calls a driver's D3dDrawPrimitives2 function. To create a pixel shader, the runtime calls D3dDrawPrimitives2 with the D3DDP2OP_CREATEPIXELSHADER operation code. To create a vertex shader in DirectX 8.1 and earlier, the runtime calls D3dDrawPrimitives2 with the D3DDP2OP_CREATEVERTEXSHADER operation code. To create a vertex shader in DirectX 9.0 and later, the runtime calls D3dDrawPrimitives2 with the D3DDP2OP_CREATEVERTEXSHADERFUNC operation code.

The Direct3D Shader Codes section describes the format of an individual shader code and the tokens that comprise each shader code:

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.