[rs] Add include_wgsl!() macro (#922)

* Add include_wgsl macro

* Add include_wgsl macro

* Change ShaderFlags to all
This commit is contained in:
Sean Moulton 2021-06-01 21:31:02 -05:00 committed by GitHub
parent 6e680d96a4
commit 9bdc65e5f7

View File

@ -57,3 +57,18 @@ macro_rules! include_spirv {
}
};
}
/// Macro to load a WGSL module statically.
#[macro_export]
macro_rules! include_wgsl {
($($token:tt)*) => {
{
//log::info!("including '{}'", $($token)*);
$crate::ShaderModuleDescriptor {
label: Some($($token)*),
source: $crate::ShaderSource::Wgsl(include_str!($($token)*).into()),
flags: $crate::ShaderFlags::all(),
}
}
};
}