Crates.io | motphys_spirv_cross |
lib.rs | motphys_spirv_cross |
version | 0.23.3 |
source | src |
created_at | 2024-02-28 08:44:19.757406 |
updated_at | 2024-02-28 09:13:21.444587 |
description | Safe wrapper around SPIRV-Cross |
homepage | https://github.com/Motphys/spirv_cross |
repository | https://github.com/Motphys/spirv_cross |
max_upload_size | |
id | 1156209 |
size | 2,841,346 |
This is a fork of spirv_cross maintained by Motphys.
Features different from original:
spirv_cross
provides a safe wrapper around SPIRV-Cross for use with Rust. For example, here is a simple function to parse a SPIR-V module and compile it to HLSL and MSL:
extern crate spirv_cross;
use spirv_cross::{spirv, hlsl, msl, ErrorCode};
fn example(module: spirv::Module) -> Result<(), ErrorCode> {
// Compile to HLSL
let ast = spirv::Ast::<hlsl::Target>::parse(&module)?;
println!("{}", ast.compile()?);
// Compile to MSL
let ast = spirv::Ast::<msl::Target>::parse(&module)?;
println!("{}", ast.compile()?);
Ok(())
}
This project is licensed under either of Apache License, Version 2.0 or MIT license, at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache 2.0 license, shall be dual licensed as above, without any additional terms or conditions.
See CONTRIBUTING.md.