Skip to main content

validate_wgsl

Function validate_wgsl 

Source
pub fn validate_wgsl(module: &TranslationUnit) -> Result<(), Diagnostic<Error>>
Expand description

Validate the final output (valid WGSL).

It currently does not validate a lot. It checks for:

  • Defined declarations: all identifiers refer to a user declaration or built-in name.
  • Duplicate declarations: declarations in the same scope cannot have the same name.
  • Cyclic declarations: no cycles are allowed in declarations.
  • Function calls: call expressions must refer to a function or a type constructor. Check the number of arguments but not their type.