What is the State Of WebGPU

Hello :slight_smile:

I’m quite new to WebGPU, also I think official devs would be better than me at explaining the benefits.

Still I can give my vision about this :

  • WebGPU brings an approach which is much closer to the GPU, non-only allowing more control on GPU ressources, but also minimizing CPU overhead
  • For example :
    • With WebGL, you could only compute vertex & fragment shaders, the first for vertex position compute, the second for pixel color compute, both being fully oriented toward rendering. If you where to try to do a GP-GPU process (Global Purpose calculation on GPU, for example a particule simulation) it is basically a nightware. For example HERE, particle simulation is computed with WebGL, but it’s a trick, with dozens of fragment shaders which are storing 3D particle position, velocity, force, pressure into some texture2D so basically nothing “logical” since texture2D should be only for images.
    • With WebGPU, you basically SQUASH this complexity by the usage of compute shader which are exactly for a GPGPU purpose. You just define a whatever calculation and parellize this over the thousands of processors on the GPU. For example HERE is another example where I’m using WebGPU to compute the particle simulation (again nothing about BabylonJS, sorry ^^) but if you have a look at my post about it you can quickly understand how simple it was to implement GPGPU in a web context, compared to using WebGL

I think that the current usage of WebGPU in BabylonJS is basically doing the same (as a result) than what it does in WebGL, but I’m confident that later on, we will be able to leverage the full power of WebGPU from within BabylonJS app to compute crazy good stuffs :grin:

2 Likes