Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grovesnl/spirv_cross
Safe Rust wrapper around SPIRV-Cross
https://github.com/grovesnl/spirv_cross
directx graphics metal opengl rust spir-v spirv spirv-cross vulkan
Last synced: 1 day ago
JSON representation
Safe Rust wrapper around SPIRV-Cross
- Host: GitHub
- URL: https://github.com/grovesnl/spirv_cross
- Owner: grovesNL
- License: apache-2.0
- Created: 2017-09-24T22:19:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-28T07:22:38.000Z (over 1 year ago)
- Last Synced: 2024-10-14T14:11:27.992Z (3 months ago)
- Topics: directx, graphics, metal, opengl, rust, spir-v, spirv, spirv-cross, vulkan
- Language: Rust
- Homepage:
- Size: 1.81 MB
- Stars: 86
- Watchers: 4
- Forks: 42
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
Awesome Lists containing this project
README
spirv_cross
## Example
`spirv_cross` provides a safe wrapper around [SPIRV-Cross](https://github.com/KhronosGroup/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:
```rust
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::::parse(&module)?;
println!("{}", ast.compile()?);// Compile to MSL
let ast = spirv::Ast::::parse(&module)?;
println!("{}", ast.compile()?);Ok(())
}
```## License
This project is licensed under either of [Apache License, Version
2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT), 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](CONTRIBUTING.md).