Issue automatically imported from old repo: EmbarkStudios/rust-gpu#575
Old labels: t: enhancement,c: rustc_codegen_spirv
Originally creatd by eddyb on 2021-04-05T07:04:27Z π: 3
Sadly, it's hard/impossible to account for #[cfg]
s in e.g. glam
, and vector types in general tend to have weirder alignment rules than scalars (and aggregates thereof).
But we should at the very least require #[repr(C)]
, and maybe even disallow any interior padding or wildly varying alignments (as that would imply potentially different alignments on the host).
I almost wish Rust had explicit field offsets with a per-field attribute - we could require that to guarantee that the host would see the same layout and it would let us have the weirder layouts mentioned in #11.