naga/common/mod.rs
1//! Code common to the front and backends for specific languages.
2
3mod diagnostic_debug;
4mod diagnostic_display;
5pub mod predeclared;
6pub mod wgsl;
7
8pub use diagnostic_debug::{DiagnosticDebug, ForDebug, ForDebugWithTypes};
9pub use diagnostic_display::DiagnosticDisplay;
10
11/// Helper function that returns the string corresponding to the [`VectorSize`](crate::VectorSize)
12pub const fn vector_size_str(size: crate::VectorSize) -> &'static str {
13 match size {
14 crate::VectorSize::Bi => "2",
15 crate::VectorSize::Tri => "3",
16 crate::VectorSize::Quad => "4",
17 }
18}