Function pilka_dyn::ash::util::read_spv [−]
pub fn read_spv<R>(x: &mut R) -> Result<Vec<u32, Global>, Error> where
R: Read + Seek,
Decode SPIR-V from bytes.
This function handles SPIR-V of arbitrary endianness gracefully, and returns correctly aligned storage.
Examples
// Decode SPIR-V from a file let mut file = std::fs::File::open("/path/to/shader.spv").unwrap(); let words = ash::util::read_spv(&mut file).unwrap();
// Decode SPIR-V from memory const SPIRV: &[u8] = &[ // ... ]; let words = ash::util::read_spv(&mut std::io::Cursor::new(&SPIRV[..])).unwrap();