Skip to content

Commit

Permalink
wasm: pad globals uniform also in 2d (#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 #6460
  • Loading branch information
mockersf committed Nov 18, 2022
1 parent 63c0cca commit 0a853f1
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 0a853f1

Please sign in to comment.