-
|
Anyone would know why is there a difference between std::mem::size_of and ::SHADER_SIZE ( from encase ) ? this fails: with: I tried to calculate the size in wgpu for that struct but I think I messed sth up, because it should be fine... I get the same result Why might that be and how could one fix it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
You haven't put If you're planning to use |
Beta Was this translation helpful? Give feedback.
You haven't put
#[repr(C)]on your struct, so reordering the fields isn't guaranteed to do anything to its layout.If you're planning to use
encase, why are you worrying about the layout of your Rust structs anyway? The wayencaseworks (if I understand it correctly) is that it copies the fields of your structs into the buffers it manages.