spv-cross

Crates.iospv-cross
lib.rsspv-cross
version0.23.5
sourcesrc
created_at2023-03-07 00:06:45.18411
updated_at2023-04-19 19:51:05.31094
descriptionSafe wrapper around SPIRV-Cross
homepagehttps://github.com/grovesNL/spirv_cross
repositoryhttps://github.com/grovesNL/spirv_cross
max_upload_size
id803108
size11,288,173
NotAPenguin (NotAPenguin0)

documentation

README

spirv_cross

Safe wrapper around SPIR-V Cross

Crate Travis Build Status Appveyor Build Status

Disclaimer

This is a continued version of spirv-cross with updated dependencies. MSL is currently not supported. All credit for the original version goes to Joshua Groves. If possible, I would merge the changes in this crate into the original repo (after fixing MSL).

Additional features of this fork compared to the original:

  • Acceleration structures.

Example

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(())
}

License

This project is licensed under either of Apache License, Version 2.0 or MIT license, at your option.

Contribution

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.

Commit count: 425

cargo fmt