| // Copyright 2025 the Vello Authors |
| // SPDX-License-Identifier: Apache-2.0 OR MIT |
| |
| //! WESL shader sources linked to WGSL and optionally compiled to GLSL for `vello_hybrid`. |
| |
| #[cfg(feature = "glsl")] |
| mod compile; |
| #[cfg(feature = "glsl")] |
| mod lint; |
| #[cfg(feature = "glsl")] |
| mod types; |
| |
| include!(concat!(env!("OUT_DIR"), "/compiled_shaders.rs")); |
| |
| #[cfg(all(test, feature = "glsl"))] |
| mod tests { |
| use naga::front::wgsl; |
| |
| use crate::lint::lint; |
| |
| #[test] |
| fn every_shipped_shader_passes_the_lint() { |
| assert!( |
| !crate::wgsl::ALL.is_empty(), |
| "expected at least one linked WESL shader" |
| ); |
| for &(name, source) in crate::wgsl::ALL { |
| let module = wgsl::parse_str(source).expect("linked WGSL parses"); |
| lint(name, &module); |
| } |
| } |
| } |