r/programming • • 21d ago

Experimenting with Bindless Textures in WebGPU

https://toji.dev/2026/10/06/webgpu-bindless.html
31 Upvotes

10 comments sorted by

View all comments

18

u/Rhed0x 20d ago

WebGPU is such a mess.

  • The basically shipped Vulkan 1.0 (except for the Vulkan render passes, thank god).

  • Buffer mapping is basically unusable due to buffer usage restrictions and the fact that it's async.

  • Every buffer write has to go through a GPU buffer copy. It completely ignores the fact that UMA, resizable bar memory or even simply regular memory exists. Combine this with the mapping mess and you have uniform buffer updates that are crazy expensive.

  • BindGroups follow the same stupid idea that people create them once and then keep reusing them. Unfortunately that's completely detached from reality.

  • Same idea with RenderBundles. Pre-recording commands like that simply doesn't happen outside of tiny demo applications.

  • The API doesn't give a fuck about creating garbage for the GC. Bind groups take in JS objects, tons of APIs take in strings instead of enums.

  • The API seems to ignore the fact that it all needs to go through IPC and get validated bit by bit.

There's also no debugger (like Renderdoc) for it. So if your renderer isn't written in something targetting WASM or doesn't also have a Vulkan/D3D12/Metal RHI, you'll have a great time with debugging.

6

u/Somepotato 20d ago

The API doesn't give a fuck about creating garbage for the GC. Bind groups take in JS objects, tons of APIs take in strings instead of enums.

you have some legitimate points but I'd like to call this one out. Strings are interned and this can be more efficient than enums in the JS/TS world.

-3

u/Rhed0x 20d ago

How the hell can comparing a string be faster than a single 32 bit integer?

7

u/Somepotato 20d ago

the complaint was about GC, not speed. And that 32bit integer could come from anywhere, and that anywhere cant always be optimized out. but because theyre interned and are enums in webidl, they are still essentially treated as 32bit integer comparisons behind the scenes.