Fix wasm crashing on startup

This commit is contained in:
Lauri Räsänen 2023-11-05 00:16:34 +02:00
parent 7aa70cd564
commit 091bdcaa98
6 changed files with 41 additions and 15 deletions

View file

@ -16,8 +16,15 @@ struct Light {
@group(1) @binding(0)
var<uniform> light: Light;
// Needs to be 16 bytes in WebGL
struct LightMatrixIndex {
value: u32,
_padding: u32,
_padding1: u32,
_padding2: u32,
}
@group(1) @binding(1)
var<uniform> light_matrix_index: u32;
var<uniform> light_matrix_index: LightMatrixIndex;
struct VertexInput {
@location(0) position: vec3<f32>,