Back home 🏡 WGSL Spec Bevy WGSL Functions

game_of_life.wgsl

Bindings

Name Group Binding index Binding type Type
input # 0 0 texture_storage_2d<r32float, read>
output # 0 1 texture_storage_2d<r32float, write>

Functions

hash

#
fn hash(value: u32) -> u32
Parameter Type
value u32
Returns: u32

randomFloat

#
fn randomFloat(value: u32) -> f32
Parameter Type
value u32
Returns: f32

init

#
@compute
fn init(invocation_id: vec3<u32>, num_workgroups: vec3<u32>)
Parameter Type
invocation_id vec3<u32>
num_workgroups vec3<u32>

is_alive

#
fn is_alive(location: vec2<i32>, offset_x: i32, offset_y: i32) -> i32
Parameter Type
location vec2<i32>
offset_x i32
offset_y i32
Returns: i32

count_alive

#
fn count_alive(location: vec2<i32>) -> i32
Parameter Type
location vec2<i32>
Returns: i32

update

#
@compute
fn update(invocation_id: vec3<u32>)
Parameter Type
invocation_id vec3<u32>