aclysma_spirv_cross

Crates.ioaclysma_spirv_cross
lib.rsaclysma_spirv_cross
version0.0.1
sourcesrc
created_at2024-02-17 12:28:52.993139
updated_at2024-02-17 12:28:52.993139
descriptionSafe wrapper around SPIRV-Cross
homepagehttps://github.com/aclysma/spirv_cross.git
repositoryhttps://github.com/aclysma/spirv_cross.git
max_upload_size
id1143191
size2,783,547
Philip Degarmo (aclysma)

documentation

README

(Fork of) spirv_cross

Safe wrapper around SPIR-V Cross

Crate Travis Build Status Appveyor Build Status

Fork Information

This repository exists so that my other projects that require a few extra PRs that have not been merged can be published.

Unless you also want those commits, I suggest using the original:

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: 0

cargo fmt