Class Compiler
- Namespace
- Pie.ShaderCompiler
- Assembly
- Pie.ShaderCompiler.dll
Provides cross-platform API-independent shader compilation functions.
public static class Compiler
- Inheritance
-
Compiler
- Inherited Members
Methods
FromSpirv(Language, ShaderStage, byte[], string, SpecializationConstant[])
Transpile Spir-V to shader source code.
public static CompilerResult FromSpirv(Language language, ShaderStage stage, byte[] spirv, string entryPoint, SpecializationConstant[] constants)
Parameters
language
LanguageThe language to transpile to.
stage
ShaderStageThe shader stage.
spirv
byte[]The Spir-V bytecode to transpile.
entryPoint
stringThe shader's entry point function name.
constants
SpecializationConstant[]Any specialization constants to use. This value can be null.
Returns
- CompilerResult
The CompilerResult of this compilation.
Exceptions
- ArgumentOutOfRangeException
Thrown if an unsupported
language
is used.
ToSpirv(ShaderStage, Language, byte[], string)
Compile GLSL/HLSL code to Spir-V.
public static CompilerResult ToSpirv(ShaderStage stage, Language language, byte[] source, string entryPoint)
Parameters
stage
ShaderStageThe shader ShaderStage to compile.
language
LanguageThe source's shading language.
source
byte[]The source code, in ASCII representation.
entryPoint
stringThe entry point of the shader. Usually "main" for GLSL.
Returns
- CompilerResult
The CompilerResult of this compilation.
Exceptions
- ArgumentOutOfRangeException
Thrown if an unsupported
language
is used.