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
//! Slang shader compiler integration.
//!
//! This module provides Rust bindings to the [Slang](https://shader-slang.org/) shader compiler.
//! Slang is Goldy's sole shader language, supporting compilation to:
//! - SPIR-V (Vulkan)
//! - WGSL (WebGPU)
//! - HLSL (DirectX)
//! - MSL (Metal)
//! - GLSL
//!
//! **Note**: The native Slang compiler is not available on WASM targets.
//! For web builds, use slang-wasm in JavaScript to compile Slang to WGSL.
//!
//! # Example
//!
//! ```rust,no_run
//! use goldy::slang::{SlangCompiler, ShaderTarget};
//!
//! let compiler = SlangCompiler::new().unwrap();
//!
//! let source = r#"
//! [shader("vertex")]
//! float4 vs_main(float2 pos : POSITION) : SV_Position {
//! return float4(pos, 0, 1);
//! }
//!
//! [shader("fragment")]
//! float4 fs_main() : SV_Target {
//! return float4(1, 0, 0, 1);
//! }
//! "#;
//!
//! let spirv = compiler.compile(source, ShaderTarget::Spirv).unwrap();
//! println!("Compiled {} bytes of SPIR-V", spirv.data.len());
//! ```
pub use ;
pub use SlangStage;