Skip to main content

Module pass

Module pass 

Source
Expand description

Low-level reusable compilation passes.

Structs§

CompileResult
Features
Toggle conditional compilation feature flags.
ImportedItem
Module
UsedItems

Enums§

Feature
Set the behavior for a feature flag during conditional translation.

Traits§

CompilerDriver
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 after pass::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).

Type Aliases§

Imports