Skip to content

Struct u32 field is always 0 #206

Answered by Firestar99
Steveplays28 asked this question in Q&A
Discussion options

You must be logged in to vote

Currently, Vec3 has a different representation between the CPU (12 bytes) and GPU (16 bytes). So for now, please just use Vec4 for any structs that are communicated between host and device.

@LegNeato maybe we should rebase this PR, which iirc makes Vec3 be 12 bytes on the GPU as well. (I've got a different workaround in my project, basically I convert all glam Vec's to [f32; 3] and then layout always matches)

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Steveplays28
Comment options

@LegNeato
Comment options

@LegNeato
Comment options

@Firestar99
Comment options

Answer selected by Steveplays28
@LegNeato
Comment options

@Firestar99
Comment options

@Steveplays28
Comment options

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