pub fn pack(fields: &[FieldDesc], values: &[MaterialValue]) -> Option<Vec<u8>>Expand description
Packs values (in the same order as fields) into a single contiguous
byte buffer using std430 layout rules (array-of-structs).
Returns None if values.len() != fields.len() or if any value’s type
doesn’t match its field’s declared type.