WebGPU compute-boids sample ported to sokol_gfx.h compute shaders (wip, not yet merged):

C source: https://github.com/floooh/sokol-samples/blob/sgcompute/sapp/computeboids-sapp.c
GLSL source: https://github.com/floooh/sokol-samples/blob/sgcompute/sapp/computeboids-sapp.glsl

sokol-samples/sapp/computeboids-sapp.c at sgcompute · floooh/sokol-samples

Sample code for https://github.com/floooh/sokol. Contribute to floooh/sokol-samples development by creating an account on GitHub.

GitHub

The original WebGPU sample is here:

https://webgpu.github.io/webgpu-samples/?sample=computeBoids

I think line-count wise, sokol-gfx is doing pretty well :) (223 lines of C code vs 341 lines of Typescript - both without shader code)

WebGPU Samples

The WebGPU Samples are a set of samples demonstrating the use of the WebGPU API.

@floooh great job. I really value your work. I'm looking forward to making some cool stuff on top of this