Expand description
Low-level reusable compilation passes.
Structs§
- Compile
Result - Features
- Toggle conditional compilation feature flags.
- Imported
Item - Module
- Used
Items
Enums§
- Feature
- Set the behavior for a feature flag during conditional translation.
Traits§
- Compiler
Driver - Re-implementing this trait gives full control over the steps of the compilation pipeline.
It is implemented by
crate::Compiler. - Visit
Functions§
- compile
- Default implementation of
CompilerDriver::compile - compile_
async - condcomp
- Run the conditional translation phase, eliminating unused code branches.
- flatten_
imports - Flatten imports to a list.
- imported_
item_ path - Find the normalized module path for an identifier in source, if it refers to an external declaration.
- link
- Merge all declarations into a single module.
- load_
module - Note: it does not call
pass::retarget_idents, because that must be done right afterpass::condcomp. - load_
module_ async - lower
- Performs conversions on the final syntax tree to make it more compatible with WGSL implementations like Naga, catch errors early and perform optimizations.
- main_
entry_ points - mangle
- Mangle all declarations in all modules. Should be called after
retarget_idents. - module_
usage_ analysis - Find declarations used in external modules which this module depends on, no matter what.
- retarget_
idents - Make all identifiers that point to the same declaration refer to the same string.
- retarget_
modules - Retarget used identifiers to point at the corresponding declaration.
- strip_
visibility - Remove visibility markers (
public/private) in a module, i.e. make all declarations package-visible. - usage_
analysis - Find declaration names which a local declaration depends on.
- validate_
wesl - Validate an intermediate WESL module.
- validate_
wgsl - Validate the final output (valid WGSL).