Skip to main content

as_bytes

Function as_bytes 

Source
pub fn as_bytes<T: Pod>(val: &T) -> &[u8] 
Expand description

Convert a Pod value to a byte slice suitable for KernelArg::Bytes.

§Safety

The caller must ensure T has the same layout as the corresponding MSL struct in the shader (matching field order, sizes, and alignment).