From 0a853f1ca64371ed734eb98f7f84c46273c6076d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Fri, 18 Nov 2022 21:02:56 +0000 Subject: [PATCH] wasm: pad globals uniform also in 2d (#6643) # Objective - Fix a panic in wasm when using globals in a shader ## Solution - Similar to #6460 --- crates/bevy_sprite/src/mesh2d/mesh2d_view_types.wgsl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bevy_sprite/src/mesh2d/mesh2d_view_types.wgsl b/crates/bevy_sprite/src/mesh2d/mesh2d_view_types.wgsl index 1759fa499f..78c3459235 100644 --- a/crates/bevy_sprite/src/mesh2d/mesh2d_view_types.wgsl +++ b/crates/bevy_sprite/src/mesh2d/mesh2d_view_types.wgsl @@ -21,4 +21,8 @@ struct Globals { // Frame count since the start of the app. // It wraps to zero when it reaches the maximum value of a u32. frame_count: u32, +#ifdef SIXTEEN_BYTE_ALIGNMENT + // WebGL2 structs must be 16 byte aligned. + _wasm_padding: f32 +#endif }