?/TD>
Microsoft DirectX 9.0

ID3DXEffectCompiler::CompileShader Method


Compile a shader from an effect that contains one or more functions.

Syntax

HRESULT CompileShader(      

    D3DXHANDLE hFunction,     DWORD Target,     DWORD Flags,     LPD3DXBUFFER *ppShader,     LPD3DXBUFFER *ppErrorMsgs,     LPD3DXSHADER_CONSTANTTABLE *ppConstantTable );

Parameters

hFunction
[in] Unique identifier to the function to be compiled. This value must not be NULL. See Handles.
Target
[in] Identifies the compile target. The compile target is the shader version encoded in a DWORD. Use the D3DVS_VERSION macro to generate the encoded version number. This method currently supports compiling a vertex shader only.
Flags
[in] Compile options. For more information, see D3DXSHADER.
ppShader
[out, retval] Buffer containing the compiled shader. The compiler shader is an array of DWORDs. For more information about accessing the buffer, see ID3DXBuffer.
ppErrorMsgs
[out, retval] Buffer containing at least the first compile error message that occurred. This includes effect compiler errors and high-level language compile errors. For more information about accessing the buffer, see ID3DXBuffer.
ppConstantTable
[out, retval] Pointer to the constant table. For more information about the contents of the constant table, see D3DXSHADER_CONSTANTTABLE. Alternatively, the constant table can be accessed using D3DXGetShaderConstantTable.

Return Value

If the method succeeds, the return value is S_OK.

If the arguments are invalid, the method will return D3DERR_INVALIDCALL.

If the method fails, the return value will be E_FAIL.



Remarks

This method compiles a shader from a function that is written in a C-like language. For more information, see High-Level Shader Language.

See Also

D3DXSHADER_CONSTANTINFO, D3DXSHADER_CONSTANTTABLE, D3DXGetShaderConstantTable


© 2002 Microsoft Corporation. All rights reserved.