Class D3DCompile
Contains methods for compiling HLSL shaders.
Inherited Members
Namespace: JeremyAnsel.DirectX.D3DCompiler
Assembly: JeremyAnsel.DirectX.D3DCompiler.dll
Syntax
public static class D3DCompile
Methods
| Edit this page View SourceCompile(string?, string?, D3DShaderMacro[]?, string?, string?, D3DCompileOptions, out byte[]?, out string?)
Compile HLSL code or an effect file into bytecode for a given target.
Declaration
public static void Compile(string? sourceData, string? sourceName, D3DShaderMacro[]? defines, string? entrypoint, string? target, D3DCompileOptions options, out byte[]? code, out string? errorMessages)
Parameters
Type | Name | Description |
---|---|---|
string | sourceData | Uncompiled shader data. |
string | sourceName | You can use this parameter for strings that specify error messages. If not used, set to |
D3DShaderMacro[] | defines | An array of macro definitions. |
string | entrypoint | The name of the shader entry point function where shader execution begins. |
string | target | A string that specifies the shader target or set of shader features to compile against. |
D3DCompileOptions | options | Constants that specify how the compiler compiles the HLSL code. |
byte[] | code | A pointer to a variable that receives the compiled code. |
string | errorMessages | A pointer to a variable that receives compiler error messages, or |
Compile(string?, string?, string?, string?, D3DCompileOptions, out byte[]?, out string?)
Compile HLSL code or an effect file into bytecode for a given target.
Declaration
public static void Compile(string? sourceData, string? sourceName, string? entrypoint, string? target, D3DCompileOptions options, out byte[]? code, out string? errorMessages)
Parameters
Type | Name | Description |
---|---|---|
string | sourceData | Uncompiled shader data. |
string | sourceName | You can use this parameter for strings that specify error messages. If not used, set to |
string | entrypoint | The name of the shader entry point function where shader execution begins. |
string | target | A string that specifies the shader target or set of shader features to compile against. |
D3DCompileOptions | options | Constants that specify how the compiler compiles the HLSL code. |
byte[] | code | A pointer to a variable that receives the compiled code. |
string | errorMessages | A pointer to a variable that receives compiler error messages, or |
CompileFromFile(string?, D3DShaderMacro[]?, string?, string?, D3DCompileOptions, out byte[]?, out string?)
Compile HLSL code or an effect file into bytecode for a given target.
Declaration
public static void CompileFromFile(string? sourceFileName, D3DShaderMacro[]? defines, string? entrypoint, string? target, D3DCompileOptions options, out byte[]? code, out string? errorMessages)
Parameters
Type | Name | Description |
---|---|---|
string | sourceFileName | The name of the file that contains the shader code. |
D3DShaderMacro[] | defines | An array of macro definitions. |
string | entrypoint | The name of the shader entry point function where shader execution begins. |
string | target | A string that specifies the shader target or set of shader features to compile against. |
D3DCompileOptions | options | Constants that specify how the compiler compiles the HLSL code. |
byte[] | code | A pointer to a variable that receives the compiled code. |
string | errorMessages | A pointer to a variable that receives compiler error messages, or |
CompileFromFile(string?, string?, string?, D3DCompileOptions, out byte[]?, out string?)
Compile HLSL code or an effect file into bytecode for a given target.
Declaration
public static void CompileFromFile(string? sourceFileName, string? entrypoint, string? target, D3DCompileOptions options, out byte[]? code, out string? errorMessages)
Parameters
Type | Name | Description |
---|---|---|
string | sourceFileName | The name of the file that contains the shader code. |
string | entrypoint | The name of the shader entry point function where shader execution begins. |
string | target | A string that specifies the shader target or set of shader features to compile against. |
D3DCompileOptions | options | Constants that specify how the compiler compiles the HLSL code. |
byte[] | code | A pointer to a variable that receives the compiled code. |
string | errorMessages | A pointer to a variable that receives compiler error messages, or |
Disassemble(byte[]?)
Disassembles compiled HLSL code.
Declaration
public static string Disassemble(byte[]? sourceData)
Parameters
Type | Name | Description |
---|---|---|
byte[] | sourceData | The source data as compiled HLSL code. |
Returns
Type | Description |
---|---|
string | The assembly text. |
Disassemble(byte[]?, D3DDisassembleOptions)
Disassembles compiled HLSL code.
Declaration
public static string Disassemble(byte[]? sourceData, D3DDisassembleOptions options)
Parameters
Type | Name | Description |
---|---|---|
byte[] | sourceData | The source data as compiled HLSL code. |
D3DDisassembleOptions | options | Flags affecting the behavior of |
Returns
Type | Description |
---|---|
string | The assembly text. |
Disassemble(byte[]?, D3DDisassembleOptions, string?)
Disassembles compiled HLSL code.
Declaration
public static string Disassemble(byte[]? sourceData, D3DDisassembleOptions options, string? comments)
Parameters
Type | Name | Description |
---|---|---|
byte[] | sourceData | The source data as compiled HLSL code. |
D3DDisassembleOptions | options | Flags affecting the behavior of |
string | comments | The comment string at the top of the shader that identifies the shader constants and variables. |
Returns
Type | Description |
---|---|
string | The assembly text. |