From 1b88fa874a6d36393a2d0be6b39feab4973a0766 Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Thu, 26 Jan 2023 23:43:13 +0000 Subject: [PATCH 1/2] Use #[repr(C)] for vertex & constant structs. Fixes issues with rust 1.67 field ordering. --- CHANGELOG.md | 3 +++ src/render/src/macros/structure.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c75aff0686..156987ee586 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Change Log +### v0.18.3 + - `gfx_defines!` uses `#[repr(C)]` for vertex & constant structs. Fixes issues with rust 1.67 field ordering. + ### v0.18 (2019-02-12) - changed `get_dimensions` to return a minimum of 1 - Features: diff --git a/src/render/src/macros/structure.rs b/src/render/src/macros/structure.rs index cf4541b5ffe..673496b1f67 100644 --- a/src/render/src/macros/structure.rs +++ b/src/render/src/macros/structure.rs @@ -95,7 +95,7 @@ macro_rules! gfx_vertex_struct_meta { ($(#[$attr:meta])* vertex_struct_meta $root:ident { $( $(#[$field_attr:meta])* $field:ident: $ty:ty = $name:expr, )* }) => (gfx_impl_struct_meta!{ - $(#[$attr])* impl_struct_meta + $(#[$attr])* #[repr(C)] impl_struct_meta $crate::format::Format : $crate::format::Formatted = $root { $( $(#[$field_attr])* $field: $ty = $name, )* @@ -121,7 +121,7 @@ macro_rules! gfx_constant_struct_meta { ($(#[$attr:meta])* constant_struct_meta $root:ident { $( $(#[$field_attr:meta])* $field:ident: $ty:ty = $name:expr, )* }) => (gfx_impl_struct_meta!{ - $(#[$attr])* impl_struct_meta + $(#[$attr])* #[repr(C)] impl_struct_meta $crate::shade::ConstFormat : $crate::shade::Formatted = $root { $( $(#[$field_attr])* $field: $ty = $name, )* From 772642d6f3e16cda6fda8c4e94e27c55ca119fea Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Fri, 24 Feb 2023 12:01:29 +0000 Subject: [PATCH 2/2] Up gfx version to 0.18.3 --- src/render/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render/Cargo.toml b/src/render/Cargo.toml index bdca7bfa6a8..7ae3a3ba3dc 100644 --- a/src/render/Cargo.toml +++ b/src/render/Cargo.toml @@ -14,7 +14,7 @@ [package] name = "gfx" -version = "0.18.2" +version = "0.18.3" description = "A high-performance, bindless graphics API" homepage = "https://github.com/gfx-rs/gfx" repository = "https://github.com/gfx-rs/gfx"