Crates.io | spirvcross |
lib.rs | spirvcross |
version | 0.1.2 |
source | src |
created_at | 2023-07-30 06:35:53.427598 |
updated_at | 2023-12-01 11:21:04.167243 |
description | Bindings to SPIRV-Cross API |
homepage | |
repository | https://github.com/Aandreba/spirv-cross |
max_upload_size | |
id | 929764 |
size | 10,714,192 |
High and low level bindigns to the SPIRV-Cross API
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(());
}