Open nbvdkamp opened 1 year ago
Yes, they must be #[repr(C)]
. I’ll add something to check that in the proc-macro.
Luminance should use memoffset::offset_of
, field_offset::offset_of
, or equivalent to find the offsets in a way that works with #[repr(Rust)]
.
After updating my nightly rust install my luminance application started rendering my models completely incorrectly, as if the attribute data is being garbled. On the 2022-11-11 nightly build it still works as expected so I'm quite sure https://github.com/rust-lang/rust/pull/102750 being merged is what caused things to break, though I haven't bisected yet.
This is my vertex struct:
Adding
#[repr(C)]
toVertex
fixes the issue so presumably luminance makes a bad assumption somewhere about vertex struct layout being not being reordered.