Processing Shader Codes
The user-mode display driver uses vertex declarations, and the tokens within each individual pixel and vertex shader code, to program shader assemblers.
The user-mode display driver receives vertex and pixel shader code when the Microsoft Direct3D runtime calls the driver's CreateVertexShaderFunc and CreatePixelShader functions, respectively. The user-mode display driver receives vertex declarations when the runtime calls the driver's CreateVertexShaderDecl function. The vertex declarations consist of arrays of D3DDDIVERTEXELEMENT structures. The user-mode display driver converts shader code and vertex shader declarations into a hardware-specific format and associates the shader code and declarations with shader and declaration handles. The runtime uses the created handles in calls to the SetVertexShaderDecl, SetVertexShaderFunc, and SetPixelShader functions to set the vertex shader declaration and the vertex and pixel shaders so that all subsequent drawing operations use them.
For more information about the format of an individual shader code and the tokens that comprise each shader code, see Direct3D Shader Codes.