Class ShaderParser
Namespace: ValveResourceFormat.Renderer.Shaders
Assembly: Renderer.dll
Preprocesses shader source files and extracts defines and render modes.
public class ShaderParserInheritance
Constructors
ShaderParser()
Initializes a new instance of the class and discovers all available shader files.
public ShaderParser()Fields
ExpectedShaderVersion
The GLSL version directive that must appear as the first line of every shader file.
public const string ExpectedShaderVersion = "#version 460"Field Value
ShaderDirectory
The embedded-resource namespace prefix used to locate shader files in the assembly manifest.
public const string ShaderDirectory = "Renderer.Shaders."Field Value
Properties
AvailableShaders
Gets the map from shader base names to a bool array indicating which pipeline stages (vertex, fragment, compute) exist on disk or in the assembly manifest.
public Dictionary<string, bool[]> AvailableShaders { get; }Property Value
Dictionary<string, bool[]>
Methods
ClearBuilder()
Clears the internal so it is ready for the next preprocessing pass.
public void ClearBuilder()PreprocessShader(string, ParsedShaderData)
Reads and preprocesses a shader source file, resolving includes and extracting defines, render modes, and uniform names into parsedData.
public string PreprocessShader(string shaderFile, ShaderLoader.ParsedShaderData parsedData)Parameters
shaderFile string
The shader file path or embedded resource name (e.g. complex.vert.slang).
parsedData ShaderLoader.ParsedShaderData
The data container that accumulates extracted metadata across all stages.
Returns
The preprocessed GLSL source text ready for driver compilation.

