diff --git a/examples/cubemap/cube_mesh.zig b/examples/cubemap/cube_mesh.zig index 354bcc33..ae5b2912 100644 --- a/examples/cubemap/cube_mesh.zig +++ b/examples/cubemap/cube_mesh.zig @@ -1,4 +1,4 @@ -pub const Vertex = struct { +pub const Vertex = extern struct { pos: @Vector(4, f32), col: @Vector(4, f32), uv: @Vector(2, f32), diff --git a/examples/ecs-app/physics2d.zig b/examples/ecs-app/physics2d.zig index d22716e3..316f1c08 100644 --- a/examples/ecs-app/physics2d.zig +++ b/examples/ecs-app/physics2d.zig @@ -16,7 +16,7 @@ pub const module = ecs.Module(.{ .update = update, }); -pub const Vec2 = struct { x: f32, y: f32 }; +pub const Vec2 = extern struct { x: f32, y: f32 }; fn update(msg: Message) void { switch (msg) { diff --git a/examples/ecs-app/renderer.zig b/examples/ecs-app/renderer.zig index b14bd4c5..d1797c27 100644 --- a/examples/ecs-app/renderer.zig +++ b/examples/ecs-app/renderer.zig @@ -10,4 +10,4 @@ pub const module = ecs.Module(.{ // with renderer components like `.geometry` and render them for example! }); -pub const Vec3 = struct { x: f32, y: f32, z: f32 }; +pub const Vec3 = extern struct { x: f32, y: f32, z: f32 }; diff --git a/examples/fractal-cube/cube_mesh.zig b/examples/fractal-cube/cube_mesh.zig index 4643865d..f26c75ac 100644 --- a/examples/fractal-cube/cube_mesh.zig +++ b/examples/fractal-cube/cube_mesh.zig @@ -1,4 +1,4 @@ -pub const Vertex = struct { +pub const Vertex = extern struct { pos: @Vector(4, f32), col: @Vector(4, f32), uv: @Vector(2, f32), diff --git a/examples/gkurve/atlas.zig b/examples/gkurve/atlas.zig index d13d2476..c7db1a42 100644 --- a/examples/gkurve/atlas.zig +++ b/examples/gkurve/atlas.zig @@ -46,7 +46,7 @@ pub const Region = struct { } }; -pub const UVData = struct { +pub const UVData = extern struct { bottom_left: @Vector(2, f32), width_and_height: @Vector(2, f32), }; diff --git a/examples/gkurve/draw.zig b/examples/gkurve/draw.zig index a52ccd8a..3e933485 100644 --- a/examples/gkurve/draw.zig +++ b/examples/gkurve/draw.zig @@ -7,7 +7,7 @@ const UVData = @import("atlas.zig").UVData; const Vec2 = @Vector(2, f32); -pub const Vertex = struct { +pub const Vertex = extern struct { pos: @Vector(4, f32), uv: Vec2, }; @@ -31,7 +31,7 @@ const GkurveType = enum(u32) { filled = 2, }; -pub const FragUniform = struct { +pub const FragUniform = extern struct { type: GkurveType = .filled, // Padding for struct alignment to 16 bytes (minimum in WebGPU uniform). padding: @Vector(3, f32) = undefined, diff --git a/examples/instanced-cube/cube_mesh.zig b/examples/instanced-cube/cube_mesh.zig index 4643865d..f26c75ac 100644 --- a/examples/instanced-cube/cube_mesh.zig +++ b/examples/instanced-cube/cube_mesh.zig @@ -1,4 +1,4 @@ -pub const Vertex = struct { +pub const Vertex = extern struct { pos: @Vector(4, f32), col: @Vector(4, f32), uv: @Vector(2, f32), diff --git a/examples/pixel-post-process/cube_mesh.zig b/examples/pixel-post-process/cube_mesh.zig index 98c2578e..edf25840 100644 --- a/examples/pixel-post-process/cube_mesh.zig +++ b/examples/pixel-post-process/cube_mesh.zig @@ -1,4 +1,4 @@ -pub const Vertex = struct { +pub const Vertex = extern struct { pos: @Vector(3, f32), normal: @Vector(3, f32), uv: @Vector(2, f32), diff --git a/examples/pixel-post-process/main.zig b/examples/pixel-post-process/main.zig index 97a22424..6e602a51 100644 --- a/examples/pixel-post-process/main.zig +++ b/examples/pixel-post-process/main.zig @@ -16,7 +16,7 @@ const pixel_size = 8; const UniformBufferObject = struct { mat: zm.Mat, }; -const PostUniformBufferObject = struct { +const PostUniformBufferObject = extern struct { width: u32, height: u32, pixel_size: u32 = pixel_size, diff --git a/examples/pixel-post-process/quad_mesh.zig b/examples/pixel-post-process/quad_mesh.zig index f3828303..57db212f 100644 --- a/examples/pixel-post-process/quad_mesh.zig +++ b/examples/pixel-post-process/quad_mesh.zig @@ -1,4 +1,4 @@ -pub const Quad = struct { +pub const Quad = extern struct { pos: @Vector(3, f32), uv: @Vector(2, f32), }; diff --git a/examples/rotating-cube/cube_mesh.zig b/examples/rotating-cube/cube_mesh.zig index 4643865d..f26c75ac 100644 --- a/examples/rotating-cube/cube_mesh.zig +++ b/examples/rotating-cube/cube_mesh.zig @@ -1,4 +1,4 @@ -pub const Vertex = struct { +pub const Vertex = extern struct { pos: @Vector(4, f32), col: @Vector(4, f32), uv: @Vector(2, f32), diff --git a/examples/textured-cube/cube_mesh.zig b/examples/textured-cube/cube_mesh.zig index 354bcc33..ae5b2912 100644 --- a/examples/textured-cube/cube_mesh.zig +++ b/examples/textured-cube/cube_mesh.zig @@ -1,4 +1,4 @@ -pub const Vertex = struct { +pub const Vertex = extern struct { pos: @Vector(4, f32), col: @Vector(4, f32), uv: @Vector(2, f32), diff --git a/examples/two-cubes/cube_mesh.zig b/examples/two-cubes/cube_mesh.zig index 4643865d..f26c75ac 100644 --- a/examples/two-cubes/cube_mesh.zig +++ b/examples/two-cubes/cube_mesh.zig @@ -1,4 +1,4 @@ -pub const Vertex = struct { +pub const Vertex = extern struct { pos: @Vector(4, f32), col: @Vector(4, f32), uv: @Vector(2, f32),