#librashader #spir-v

librashader-spirv-cross

spirv_cross fork maintained for librashader

7 releases

0.25.1 Feb 12, 2024
0.25.0 Feb 11, 2024
0.24.0 Feb 11, 2024
0.23.5 Jan 26, 2023

#64 in Graphics APIs

Download history 68/week @ 2023-11-06 30/week @ 2023-11-13 60/week @ 2023-11-20 217/week @ 2023-11-27 22/week @ 2023-12-04 43/week @ 2023-12-11 36/week @ 2023-12-18 51/week @ 2023-12-25 18/week @ 2024-01-01 46/week @ 2024-01-08 75/week @ 2024-01-15 31/week @ 2024-01-22 504/week @ 2024-01-29 1312/week @ 2024-02-05 1737/week @ 2024-02-12 957/week @ 2024-02-19

4,510 downloads per month
Used in 7 crates (3 directly)

MIT/Apache

2.5MB
58K SLoC

C++ 48K SLoC // 0.1% comments Rust 10K SLoC // 0.0% comments Swift 60 SLoC // 0.1% comments AsciiDoc 6 SLoC // 0.3% comments

librashader-spirv-cross

(Hopefully) temporary fork of spirv_cross while some changes get upstreamed.

Please do not use this.

spirv_cross

Safe wrapper around SPIR-V Cross

Crate Travis Build Status Appveyor Build Status

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.

Dependencies