Skip to content

Namespace Apogee.Rendering.Shaders

Classes

PipelineScope

The pipelines one build made. Disposing destroys them all; they go through when a rebuild replaces them.

ReloadablePipelines<T>

The pipelines a renderer builds from some shader modules, rebuilt when one of them changes (or a module it imports) without stalling the frame. A change starts a build on another thread: the shaders are compiled through the and the pipelines made, while the renderer carries on with . The renderer calls at the start of a frame; if a build has finished, the new pipelines become current there, and the old ones are destroyed through once the GPU is done with the frames that used them. A build that fails (a shader that does not compile) leaves as it was, is logged, and shows in until a later build works. Changes that arrive during a build start another one right after it.

ShaderImporter

Slang modules into s (.ashader): each module with entry points is compiled to SPIR-V (Vulkan) and to Metal shading language (Metal), with its reflection, once without defines and once for each <Variant> its .import.xml lists. The files the compiler read (import, #include) are the artifact's dependencies, so editing a library re-imports every shader that uses it, and the library is not imported on its own. A module with no [shader(…)] entry point is not an asset: it only serves the others.

ShaderLibrary

Where renderers get their shaders. takes the compiled artifact of a shader module when its project was imported (), which is how a shipped game and a mod that ships its shaders work: the Slang compiler is never loaded. A module without an artifact is compiled, as in development, if the compiler is there, and the error says what to do when it is not. The engine's own shaders are mounted as shaders:// (); a mod's are at mod://id/…, with their artifacts in mod://id/imported. The library remembers which files each module it loaded was made from, so that when files change (, from HotReloader.ShadersChanged or a ) it can say which modules are out of date (): rebuilds on that. It is thread safe.