spirv-cross2
Safe and sound Rust bindings to SPIRV-Cross.
All backends exposed by the SPIRV-Cross C API are fully supported, including
- GLSL
- HLSL
- MSL
- JSON
- C++
- Reflection Only
The API provided is roughly similar to the SPIRV-Cross Compiler C++ API,
with some inspiration from naga. A best effort has been
made to ensure that these bindings are sound, and that mutations occur strictly within Rust's borrow rules.
Usage
Here is an example of using the API to do some reflection and compile to GLSL.
use ;
use ;
use GlslVersion;
use ;
use spirv;
use Glsl;
f16 and vector specialization constants support
When querying specialization constants, spirv-cross2 includes optional support for f16 via half and Vec2, Vec3, Vec4, and Mat4 types
via gfx-maths. This is included by default, but can be disabled by disabling default features.
[]
= { = false }
License
This project is licensed under either of Apache License, Version 2.0 or MIT license, at your option.
Contributing
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed under the terms of both the Apache License, Version 2.0 and the MIT license without any additional terms or conditions.