https://github.com/penguinliong/spirq-rs
Light weight SPIR-V reflection library
https://github.com/penguinliong/spirq-rs
glsl hlsl rust spirv vulkan wgsl
Last synced: 5 months ago
JSON representation
Light weight SPIR-V reflection library
- Host: GitHub
- URL: https://github.com/penguinliong/spirq-rs
- Owner: PENGUINLIONG
- License: apache-2.0
- Created: 2019-11-25T12:23:56.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-28T12:46:53.000Z (10 months ago)
- Last Synced: 2025-05-09T10:19:28.233Z (5 months ago)
- Topics: glsl, hlsl, rust, spirv, vulkan, wgsl
- Language: Rust
- Homepage:
- Size: 904 KB
- Stars: 112
- Watchers: 2
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# spirq
[](https://crates.io/crates/spirq)
[](https://docs.rs/spirq)`spirq` is a shader reflection tool to help you process SPIR-V binary and assembly for Vulkan. You can use `spirq` to query host-shader interfaces including descriptor bindings, pipeline inputs and outputs, specialization constants.
You can also use the commandline (CLI) tool [`shader-reflect`](shader-reflect/README.md) to use `spirq` without programming in Rust.
> Note: `spirq-` family of crates have been moved to [`spq`](https://github.com/PENGUINLIONG/spq-rs).
## Usage
See [the crate level readme](spirq/README.md) for detail.
## What's different from other crates?
Compared with spirq, `rspirv` has more strict requirements on SPIR-V physical layout, which makes it impossible to process bad test cases for other projects. `spirv-reflect` is a broadly used reflection tool and it's a wrapper crate of Khronos' official [SPIRV-Reflect](https://github.com/KhronosGroup/SPIRV-Reflect) tool. `SPIRV-Reflect`, however, was developed in pretty early days and it has some legacy bad designs (like a limit of 16 descriptors). [SPIRV-Tools](https://github.com/KhronosGroup/SPIRV-Reflect) provides Khronos' official assembler and disassembler, while it's hard to be integrated to other Rust projects.
On the other hand, the tools in spirq are more tolerant of the input quality. They don't check the semantics strictly to the spec. They won't stop processing unless there is a fatal structural problem making the input totally indecipherable. As a result, you might have to be familiar with the SPIR-V specification so that it serves you well, if you are developing other tools based on spirq.
## License
This project is licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)at your option.