Skip to content

Commit

Permalink
wasm: pad globals uniform also in 2d (bevyengine#6643)
Browse files Browse the repository at this point in the history
# Objective

- Fix a panic in wasm when using globals in a shader

## Solution

- Similar to bevyengine#6460
  • Loading branch information
mockersf authored and ItsDoot committed Feb 1, 2023
1 parent 72f1408 commit c0753d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/bevy_sprite/src/mesh2d/mesh2d_view_types.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit c0753d3

Please sign in to comment.