Skip to content

Commit 7702f93

Browse files
alexheretickvark
authored andcommitted
Use #[repr(C)] for vertex & constant structs.
Fixes issues with rust 1.67 field ordering.
1 parent fbd2e25 commit 7702f93

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Change Log
22

3+
### v0.18.3
4+
- `gfx_defines!` uses `#[repr(C)]` for vertex & constant structs. Fixes issues with rust 1.67 field ordering.
5+
36
### v0.18 (2019-02-12)
47
- changed `get_dimensions` to return a minimum of 1
58
- Features:

src/render/src/macros/structure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ macro_rules! gfx_vertex_struct_meta {
9595
($(#[$attr:meta])* vertex_struct_meta $root:ident {
9696
$( $(#[$field_attr:meta])* $field:ident: $ty:ty = $name:expr, )*
9797
}) => (gfx_impl_struct_meta!{
98-
$(#[$attr])* impl_struct_meta
98+
$(#[$attr])* #[repr(C)] impl_struct_meta
9999
$crate::format::Format : $crate::format::Formatted =
100100
$root {
101101
$( $(#[$field_attr])* $field: $ty = $name, )*
@@ -121,7 +121,7 @@ macro_rules! gfx_constant_struct_meta {
121121
($(#[$attr:meta])* constant_struct_meta $root:ident {
122122
$( $(#[$field_attr:meta])* $field:ident: $ty:ty = $name:expr, )*
123123
}) => (gfx_impl_struct_meta!{
124-
$(#[$attr])* impl_struct_meta
124+
$(#[$attr])* #[repr(C)] impl_struct_meta
125125
$crate::shade::ConstFormat : $crate::shade::Formatted =
126126
$root {
127127
$( $(#[$field_attr])* $field: $ty = $name, )*

0 commit comments

Comments
 (0)