Table of Contents

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 Language

The language to transpile to.

stage ShaderStage

The shader stage.

spirv byte[]

The Spir-V bytecode to transpile.

entryPoint string

The 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 ShaderStage

The shader ShaderStage to compile.

language Language

The source's shading language.

source byte[]

The source code, in ASCII representation.

entryPoint string

The 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.