Skip to content

Class ShaderCompiler

Namespace: Apogee.Graphics.Shaders
Assembly: Apogee.Graphics.dll

Compiles Slang to SPIR-V (Vulkan 1.3, SPIR-V 1.6) or to Metal shading language, with row-major matrices and entry points that keep their names. Thread safe: compiles are serialized, across every compiler in the process.

public sealed class ShaderCompiler

Inheritance

object ← ShaderCompiler

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

ShaderCompiler(ShaderCompilerOptions?)

public ShaderCompiler(ShaderCompilerOptions? options = null)

Parameters

options ShaderCompilerOptions?

Properties

CompilerVersion

The Slang release the engine ships, such as "2026.19".

public static string CompilerVersion { get; }

Property Value

string

IsAvailable

True when the Slang compiler library can be loaded. Games that ship without it (everything is compiled ahead of time) see false.

public static bool IsAvailable { get; }

Property Value

bool

Methods

CompileFile(string)

Compiles a shader file; its directory is searched for imports too.

public CompiledShader CompileFile(string path)

Parameters

path string

Returns

CompiledShader

CompileSource(string, string, string?)

Compiles a module given as text. path names it in diagnostics and, when it is a real file, in the cache's dependency list.

public CompiledShader CompileSource(string moduleName, string source, string? path = null)

Parameters

moduleName string

source string

path string?

Returns

CompiledShader