https://github.com/aandreba/spirv-cross
High and low level bindigns to the SPIRV-Cross API
https://github.com/aandreba/spirv-cross
Last synced: about 1 year ago
JSON representation
High and low level bindigns to the SPIRV-Cross API
- Host: GitHub
- URL: https://github.com/aandreba/spirv-cross
- Owner: Aandreba
- Created: 2023-07-27T16:35:52.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-05T11:02:14.000Z (about 2 years ago)
- Last Synced: 2025-03-28T01:40:34.947Z (about 1 year ago)
- Language: Rust
- Homepage:
- Size: 57.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# spirv-cross
High and low level bindigns to the SPIRV-Cross API
## Example
```rust
use spirvcross::{
bytes_to_words,
compiler::{glsl::GlslCompiler, Compiler},
Result,
Context,
};
fn compile(bytes: &[u8]) -> Result<()> {
let words = bytes_to_words(bytes).unwrap();
let mut context = Context::new()?;
context.set_error_callback(|err| eprintln!("{}", err.to_string_lossy()));
let compiler = GlslCompiler::new(&mut context, &words)?
.vulkan_semantics(true)?;
println!("{}", compiler.compile()?);
return Ok(());
}
```
## Supported Targets
- Linux
- macOS
- Windows
- WebAssembly (WASI)
- Compiling to WebAssembly from a Windows machine currently doesn't work.
- Android
- Building for Android currently only works on Windows.