diff --git a/assets/shaders/game_of_life.wgsl b/assets/shaders/game_of_life.wgsl index c5b94533e5..0eb5e32e6e 100644 --- a/assets/shaders/game_of_life.wgsl +++ b/assets/shaders/game_of_life.wgsl @@ -12,9 +12,9 @@ fn hash(value: u32) -> u32 { var state = value; state = state ^ 2747636419u; state = state * 2654435769u; - state = state ^ state >> 16u; + state = state ^ (state >> 16u); state = state * 2654435769u; - state = state ^ state >> 16u; + state = state ^ (state >> 16u); state = state * 2654435769u; return state; } @@ -27,7 +27,7 @@ fn randomFloat(value: u32) -> f32 { fn init(@builtin(global_invocation_id) invocation_id: vec3, @builtin(num_workgroups) num_workgroups: vec3) { let location = vec2(i32(invocation_id.x), i32(invocation_id.y)); - let randomNumber = randomFloat(invocation_id.y << 16u | invocation_id.x); + let randomNumber = randomFloat((invocation_id.y << 16u) | invocation_id.x); let alive = randomNumber > 0.9; let color = vec4(f32(alive));