examples: non-extern structs have undefined memory layout #565

Closed
opened 2022-09-21 13:20:59 +00:00 by silversquirl · 0 comments
silversquirl commented 2022-09-21 13:20:59 +00:00 (Migrated from github.com)

Any structs passed to WebGPU must be packed or extern, as Zig does not guarantee the layout of regular structs.
Many of the examples break this rule, eg:

github.com/hexops/mach@02ab8f964a/examples/textured-cube/cube_mesh.zig (L1-L5)

Any structs passed to WebGPU must be `packed` or `extern`, as Zig does not guarantee the layout of regular structs. Many of the examples break this rule, eg: https://github.com/hexops/mach/blob/02ab8f964aa217a87b21d5b3f92f21b03c4a36d4/examples/textured-cube/cube_mesh.zig#L1-L5
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach#565
No description provided.