dynamis-abi 0.7.0

Host to device record layouts, counters, and step parameters shared with WGSL
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use bytemuck::{Pod, pod_read_unaligned};
use std::mem::size_of;

pub fn decode<T: Pod>(bytes: &[u8]) -> Vec<T> {
    let width = size_of::<T>();
    assert!(
        bytes.len().is_multiple_of(width),
        "readback is not a whole number of records"
    );
    bytes
        .chunks_exact(width)
        .map(|chunk| pod_read_unaligned(chunk))
        .collect()
}