1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! WGSL (WebGPU Shading Language) code generation backend
//!
//! This module generates WGSL shader code from Windjammer AST.
//! WGSL is a domain-specific shading language for GPU compute and graphics.
//!
//! ## Design Principles
//!
//! 1. **Type Safety**: CPU/GPU struct layouts verified at compile time
//! 2. **Automatic Alignment**: Insert padding to match WGSL alignment rules
//! 3. **GPU-Optimized**: Generate efficient GPU code
//! 4. **Developer-Friendly**: Clear error messages for GPU limitations
//!
//! ## Type Mapping
//!
//! | Windjammer | WGSL |
//! |------------|------|
//! | `u32` | `u32` |
//! | `i32` | `i32` |
//! | `f32` | `f32` |
//! | `bool` | `bool` |
//! | `vec2<f32>` | `vec2<f32>` |
//! | `vec3<f32>` | `vec3<f32>` |
//! | `vec4<f32>` | `vec4<f32>` |
//! | `mat4x4<f32>` | `mat4x4<f32>` |
//!
//! ## GPU-Specific Attributes
//!
//! - `@compute(workgroup_size = [x, y, z])` - Compute shader entry point
//! - `@vertex` - Vertex shader entry point
//! - `@fragment` - Fragment shader entry point
//! - `@binding(n)` - Bind group binding
//! - `@uniform` - Uniform buffer
//! - `@storage(access)` - Storage buffer (read/write)
//!
//! ## Limitations (GPU constraints)
//!
//! - No recursion (GPU limitation)
//! - No dynamic dispatch (GPU limitation)
//! - Fixed-size arrays only
//! - Bounded loops only
pub use WgslBackend;
pub use ;
pub use ;
pub use validate_for_gpu;