Skip to main content

Module shader

Module shader 

Source
Expand description

Functionality for managing source code for shaders.

This module is used during precompilation (build.rs) and regular compilation, so it has minimal dependencies.

Re-exports§

pub use crate::shader_features::*;

Structs§

MAX_VERTEX_TEXTURE_WIDTH_STRING 🔒
ProgramSourceDigest
ShaderSourceParser

Enums§

ShaderKind
ShaderVersion

Constants§

SHADER_IMPORT 🔒

Functions§

build_shader_main_string
Walks the main .glsl file, including any imports.
build_shader_prefix_string
Walks the prefix section of the shader string, which manages the various defines for features etc.
build_shader_strings
Creates heap-allocated strings for both vertex and fragment shaders.
do_build_shader_string
Walks the given shader string and applies the output to the provided callback. Assuming an override path is not used, does no heap allocation and no I/O.
shader_source_from_file
Reads a shader source file from disk into a String.