Enum glsl::syntax::Preprocessor
source · pub enum Preprocessor {
Version(PreprocessorVersion),
Extension(PreprocessorExtension),
}Expand description
Some basic preprocessor commands.
As it’s important to carry them around the AST because they cannot be substituted in a normal preprocessor (they’re used by GPU’s compilers), those preprocessor commands are available for inspection.
Important note: others preprocessor commands can be used in your source. However, they’ll get substituted upfront. For instance, if you use have
#define foo 42defined in your file, every occurrence tofoowill get replaced by42and then treated as a normal GLSL expression (in that case, ending as anExpr::IntConst(42)value). This might be unfortunate for people seeking minimal size. However, you’re free to use a minifier aftewards to re-enable _that kind of feature. To be honest, it’s not worth it to interleave the AST with preprocessor command annotations just so that the resulting code size is minimal. Just use a minifier.
Variants§
Version(PreprocessorVersion)
Extension(PreprocessorExtension)
Trait Implementations§
source§impl Clone for Preprocessor
impl Clone for Preprocessor
source§fn clone(&self) -> Preprocessor
fn clone(&self) -> Preprocessor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more