Post

I was working on a WebGPU demo and decided to try how fast I can make it. Zig in WASM generates a buffer with command stream sorted to minimize GPU state changes. This is 10k individual draw calls, unoptimized, no instancing, no render bundles. Every object is controlled separately.

In my experience, state changes (set_bind_group) is what kills WebGPU performance, not individual draw calls. The CPU-side work WebGPU implementations currently perform to track and validate resource usages and barriers is prohibitive.

Sadly lack of bindless means that every time you want to change textures, you need a new set_bind_group() call, which destroys performance pretty quickly.

That’s true. That’s also the case with the engine Sebastian Aaltonen is working on – they don’t use textures yet. I read that some WebGPU contributors want to make bindless finally happen but that probably means it’s more than a year away.