mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
[rs] Add include_wgsl!() macro (#922)
* Add include_wgsl macro * Add include_wgsl macro * Change ShaderFlags to all
This commit is contained in:
parent
6e680d96a4
commit
9bdc65e5f7
@ -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(),
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user