SPIRV-Layout

This library parses SPIRV binaries and retrieves reflection info. It is most useful for deriving a Vulkan DescriptorSetLayout from a shader module, as well as finding offsets and names of individual fields in the Uniform Buffers of a shader.

This crate is used by the vulkan-engine.

Usage

```Rust let bytes = std::fs::read(PATH).unwrap(); let words = unsafe { slice::fromrawparts(bytes.asptr() as *const u32, bytes.len() / 4) }; let module = Module::fromwords(words).unwrap();

println!("=== UNIFORMS ==="); for var in module.getuniforms() { printvar(&module, var); }

println!("=== PUSH CONSTANTS ==="); for var in module.getpushconstants() { print_var(&module, var); } ```

For an actual usage example, see examples/reflect-shader