mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-29 09:34:09 +01:00
* Add initial pomelo glsl work * Fix ref to glsl_old * Fix idents with numbers in lexer * Use glsl_new for .vert in convert example Controlled by PREFER_GLSL_NEW=1 env var Also add simple test files * Start making parser look like spec * Port 'old' lex.rs to glsl_new * Apply fixes after rebasing * Fix clippy issue * Fix PR comments - Make into optional feature glsl-new - Minor code style improvements
34 lines
726 B
Rust
34 lines
726 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")]
|
|
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,
|
|
})
|
|
}
|
|
}
|