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
languageLanguageThe language to transpile to.
stageShaderStageThe shader stage.
spirvbyte[]The Spir-V bytecode to transpile.
entryPointstringThe shader's entry point function name.
constantsSpecializationConstant[]Any specialization constants to use. This value can be null.
Returns
- CompilerResult
The CompilerResult of this compilation.
Exceptions
- ArgumentOutOfRangeException
Thrown if an unsupported
languageis 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
stageShaderStageThe shader ShaderStage to compile.
languageLanguageThe source's shading language.
sourcebyte[]The source code, in ASCII representation.
entryPointstringThe entry point of the shader. Usually "main" for GLSL.
Returns
- CompilerResult
The CompilerResult of this compilation.
Exceptions
- ArgumentOutOfRangeException
Thrown if an unsupported
languageis used.