From 2b54f7a747c22971f762d1cc532a8cb1169ce255 Mon Sep 17 00:00:00 2001 From: "Piero V." Date: Sun, 6 Apr 2025 15:21:11 +0200 Subject: [PATCH] Always use repr(C) for vertices. --- obj-rs/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/obj-rs/src/lib.rs b/obj-rs/src/lib.rs index 6ae1631..1fb1ad0 100644 --- a/obj-rs/src/lib.rs +++ b/obj-rs/src/lib.rs @@ -91,8 +91,8 @@ pub trait FromRawVertex: Sized { /// Vertex data type of `Obj` which contains position and normal data of a vertex. #[derive(Default, Copy, PartialEq, Clone, Debug)] +#[repr(C)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "vulkano", repr(C))] #[cfg_attr(feature = "vulkano", derive(Zeroable, Pod))] pub struct Vertex { /// Position vector of a vertex. @@ -173,8 +173,8 @@ impl FromRawVertex for Vertex { /// Vertex data type of `Obj` which contains only position data of a vertex. #[derive(Default, Copy, PartialEq, Clone, Debug)] +#[repr(C)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "vulkano", repr(C))] #[cfg_attr(feature = "vulkano", derive(Zeroable, Pod))] pub struct Position { /// Position vector of a vertex. @@ -239,8 +239,8 @@ impl FromRawVertex for Position { /// Vertex data type of `Obj` which contains position, normal and texture data of a vertex. #[derive(Default, Copy, PartialEq, Clone, Debug)] +#[repr(C)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "vulkano", repr(C))] #[cfg_attr(feature = "vulkano", derive(Zeroable, Pod))] pub struct TexturedVertex { /// Position vector of a vertex.