gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.35k stars 551 forks source link

pre-ll: Vertex & constant structs fields are re-ordered in rust 1.67 so don't work #3790

Closed alexheretic closed 1 year ago

alexheretic commented 1 year ago

GFX version: v0.18

Previously working code stops working properly with rust 1.67 (though still compiles).

gfx_defines! {
    vertex Vertex {
        ...
    }
    constant Props {
        ...
    }
    ...
}

This can be manually fixed by declaring #[repr(C)]

gfx_defines! {
    #[repr(C)]
    vertex Vertex {
        ...
    }
    #[repr(C)]
    constant Props {
        ...
    }
    ...
}

I think it would be nice to release a new version that will fix this without such intervention.

alexheretic commented 1 year ago

Resolved by #3791 #3792