Skip to content

Difference between std::mem_size_of and ::SHADER_SIZE #5947

Answered by kpreid
davids91 asked this question in Q&A
Discussion options

You must be logged in to vote

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 way encase works (if I understand it correctly) is that it copies the fields of your structs into the buffers it manages.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@davids91
Comment options

@teoxoy
Comment options

@davids91
Comment options

Answer selected by davids91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants