RuntimeShader.h file
Runtime entry point of the ShaderCompiler pipeline, compiled into the game (unlike ShaderCompilerMain/Emit, which are offline-only). Compiles a ".shader" source — the same format the offline tool consumes, including "#include" directives resolved through a caller-provided FileReader — into lowered per-variant GLSL sources plus the same reflection data the offline tool computes.
RuntimeProgram owns all storage and exposes the result through the same ShaderCompiler::Program/ProgramVariant view structs that the committed generated artifacts use, so consumers (batch sizing, the reflection-fed uniform caches) handle precompiled and externally-supplied shaders identically.
Namespaces
- namespace ShaderCompiler
Classes
- struct ShaderCompiler::RuntimeVariant
- One variant of a runtime-compiled program: lowered stage sources plus merged reflection.
- class ShaderCompiler::RuntimeProgram
- A ".shader" program compiled at runtime, owning its sources and reflection.
Functions
- auto CompileRuntimeProgram(StringView content, StringView baseDir, const FileReader& reader, RuntimeProgram& out, Diagnostic& diag) -> bool
- Compiles a ".shader" source into a RuntimeProgram.
Function documentation
bool CompileRuntimeProgram(StringView content, StringView baseDir, const FileReader& reader, RuntimeProgram& out, Diagnostic& diag)
Compiles a ".shader" source into a RuntimeProgram.
| Parameters | |
|---|---|
| content | The raw ".shader" file content (before include expansion) |
| baseDir | Directory that "#include" paths are resolved against |
| reader | Reads referenced include files (the engine passes its virtual filesystem) |
| out | Receives the compiled program |
| diag | Receives the error location and message on failure |