Microsoft DirectX 9.0 SDK Update (October 2004)

EffectCompiler.CompileShader Method

Language:

Note: This documentation is preliminary and is subject to change.

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

Definition

Visual Basic .NET Public Function CompileShader( _
    ByVal functionName As EffectHandle, _
    ByVal target As String, _
    ByVal flags As ShaderFlags, _
    ByRef table As ConstantTable _
) As GraphicsStream
C# public GraphicsStream CompileShader(
    EffectHandle functionName,
    string target,
    ShaderFlags flags,
    out ConstantTable table
);
Managed C++ public: GraphicsStream* CompileShader(
    EffectHandle *functionName,
    String *target,
    ShaderFlags flags,
    ConstantTable **table
);
JScript .NET public function CompileShader(
    functionName : EffectHandle,
    target : String,
    flags : ShaderFlags,
    table : ConstantTable
) : GraphicsStream;

Parameters

functionName Microsoft.DirectX.Direct3D.EffectHandle. An EffectHandle used as a unique identifier for the function to be compiled. This value must not be null.
target System.String. String that identifies the shader version. See Remarks.
flags Microsoft.DirectX.Direct3D.ShaderFlags. One or more ShaderFlags flags that specify compile options, or 0.
table Microsoft.DirectX.Direct3D.ConstantTable. A ConstantTable object that can be used to access shader constants. This value can be null.

Return Value

Microsoft.DirectX.GraphicsStream . A GraphicsStream object that contains the compiled shader. The compiler shader is an array of Int32 Leave Site values.

Remarks

Targets for vertex shaders, pixel shaders, and texture fill functions can be specified in the target parameter. The following table lists the shader versions for each type.

Target typeShader version
Vertex shadervs_1_1, vs_2_0, vs_2_sw, vs_3_0
Pixel shaderps_1_1, ps_1_2, ps_1_3, ps_1_4, ps_2_0, ps_2_sw, ps_3_0
Texture filltx_0, tx_1

This method compiles a shader from a function that is written in a C-like language.

Exceptions
InvalidCallException The method call is invalid. For example, a method's parameter might contain an invalid value.


© 2004 Microsoft Corporation. All rights reserved. Terms of use.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center