User-facing facade for WGSL preprocess and composer utilities aligned with naga_oil.
///|
test "compose a shader through the facade" {
let composer = Composer::default()
let util_source =
#|#define_import_path test::util
#|
#|fn value() -> u32 {
#| return 1u;
#|}
#|
composer.register_source("util.wgsl", util_source)
let root_source =
#|#import test::util::value
#|
#|fn root() -> u32 {
#| return value();
#|}
#|
composer.register_source("root.wgsl", root_source)
let source = composer.compose_wgsl("root.wgsl", WgslComposeOptions::default())
assert_true(source.contains("fn root"))
}fn apply_wgsl_ifdefs_strict(source : String, shader_defs : Map[String, ShaderDefValue]) -> String raise PreprocessErrorfn apply_wgsl_template_consts(source : String, value_defines : Map[String, ShaderDefValue]) -> Stringfn default_shader_rel_path_for_module_path(module_path : String) -> Stringfn export_wgsl_with_options(composer : Composer, rel : String, compose_options : WgslComposeOptions, export_options : WgslExportOptions) -> WgslExportOutput raise ComposerErrorfn get_preprocessor_metadata(source : String, allow_defines? : Bool, collect_import_uses? : Bool) -> PreprocessorMetaData raise MetadataErrorfn scan_wgsl_source_files(root : String, options : WgslSourceScanOptions) -> Array[WgslSourceFile] raise IOErrorfn scan_wgsl_source_files_checked(root : String, options : WgslSourceScanOptions) -> (Array[WgslSourceFile], Array[WgslDiagnostic]) raise IOErrorInstall
Download zipUser-facing facade for WGSL preprocess and composer utilities aligned with naga_oil.