Skip to content

Namespace Apogee.Graphics.Shaders

Classes

CompiledShader

The result of compiling one Slang module for one backend: the code of each of its entry points (SPIR-V, or Metal shading language text), what the compiler learned about its parameters, and the files it read.

ShaderAbi

What compiled shaders assume about the engine: the bindless descriptor layout and the push-constant size every pipeline shares (). A bundle remembers the version it was made for and is refused by an engine with another, so a mod's old shader fails with a message instead of a driver crash. Bump it when BindlessHeap's layout changes, on any backend: version 2 added the Metal code and the shaders' bindless parameter block (argument buffer 1; push constants are buffer 0).

ShaderBundle

The artifact of a shader module (.ashader): one or more variants, each the module compiled with one set of preprocessor defines (the default one has none), and for each variant its reflection and the code of every entry point, per backend. A reader takes the code of the backend it runs on and skips the others, so one file serves Vulkan and Metal. The reflection is that of the first backend written (SPIR-V). Specialization constants need no variant: they stay in the SPIR-V and are listed in the reflection.

ShaderCompileException

A shader did not compile; has the compiler's messages with file and line.

ShaderCompiler

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.

ShaderCompilerOptions

Enums

ShaderBackend

The shader language of a piece of compiled code in a bundle. SPIR-V (Vulkan) and Metal shading language source (Metal) are made; DXIL is reserved so that a bundle can hold every backend of a build.