mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 08:21:25 +01:00
format major refactor Change spirv to spirv_headers Remove files First translation to naga + format Fix Int Constant error Don't add unnecessary blocks. Some cleanups format remove constructs docs fix debug leftovers format, clippy satisfy clippy
34 lines
729 B
Rust
34 lines
729 B
Rust
//! Parsers which load shaders into memory.
|
|
|
|
#[cfg(feature = "glsl")]
|
|
pub mod glsl;
|
|
#[cfg(feature = "glsl-new")]
|
|
pub mod glsl_new;
|
|
#[cfg(feature = "spirv-in")]
|
|
pub mod spv;
|
|
pub mod wgsl;
|
|
|
|
use crate::arena::Arena;
|
|
|
|
pub const GENERATOR: u32 = 0;
|
|
|
|
impl crate::Module {
|
|
fn from_header(header: crate::Header) -> Self {
|
|
crate::Module {
|
|
header,
|
|
types: Arena::new(),
|
|
constants: Arena::new(),
|
|
global_variables: Arena::new(),
|
|
functions: Arena::new(),
|
|
entry_points: Vec::new(),
|
|
}
|
|
}
|
|
|
|
fn generate_empty() -> Self {
|
|
Self::from_header(crate::Header {
|
|
version: (1, 0, 0),
|
|
generator: GENERATOR,
|
|
})
|
|
}
|
|
}
|