ponko 0.0.1

A fast 2D game engine for simulating millions of things: ECS on all cores, hot reload, an in-game inspector, AI-agent control, and a C++ API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// The compute entry point: one invocation per texel, in 8 x 8 groups.
@compute @workgroup_size(8, 8)
fn cs_compute(@builtin(global_invocation_id) id: vec3<u32>) {
    let size = vec2<i32>(textureDimensions(state_in));
    let pixel = vec2<i32>(id.xy);
    if pixel.x >= size.x || pixel.y >= size.y {
        return;
    }
    var c: Cell;
    c.value = textureLoad(state_in, pixel, 0);
    c.pixel = pixel;
    c.size = size;
    c.uv = (vec2<f32>(pixel) + 0.5) / vec2<f32>(size);
    textureStore(state_out, pixel, compute(c));
}