News for hackers. Stuff that matters.
Re:Use.GPU by Tade0 on Friday September 09, 2022 @09:24AM (#32778906)
It's a replacement for WebGL, but the key difference is that it supports compute shaders.
Re:Use.GPU by unconed on Friday September 09, 2022 @11:26AM (#32780365)
It also supports many more features in rendering which previously were unavailable or so badly supported you couldn't use them. It's basically like going from 2005 to 2015 in terms of capabilities.

There are still notable gaps, like no bindless resources or raytracing though. So don't expect e.g. unreal engine to run on WebGPU without some significant compromises.

Re:Use.GPU by markdog12 on Friday September 09, 2022 @01:04PM (#32781915)
Someone patched Chrome to enable raytracing with WebGPU: https://github.com/maierfelix/chromium-ray-tracing
Re:Use.GPU by irate2942 on Friday September 09, 2022 @09:36AM (#32779050)
WebGL2 also supports them! And now that Apple finally added support (like half a year ago(?)) to it, it can be fairly safely used
Re:Use.GPU by raphlinus on Friday September 09, 2022 @10:05AM (#32779400)
I believe WebGL compute shader development has been halted[1], in favor of making WebGPU happen. Though it's possible to run it in dev builds in some cases, I'm pretty sure there's no browser that has it on by default, and likely this won't happen.

Apple does support WebGL2, but compute shader support is not part of that core spec. The demos[2] certainly don't work in Safari in my quick test.

[1]: https://registry.khronos.org/webgl/specs/latest/2.0-compute/

[2]: https://9ballsyndrome.github.io/WebGL_Compute_shader/webgl-c...

Re:Use.GPU by pjmlp on Friday September 09, 2022 @01:10PM (#32782005)
Thanks Google that dropped them out of Chrome and we all know how the Web is basically whatever Chrome does, so WebGPU it is.
Re:Use.GPU by boppo1 on Friday September 09, 2022 @09:30AM (#32778978)
Is it a replacement? It looks more like a framework that lives on top of webgl.
Re:Use.GPU by danielvaughn on Friday September 09, 2022 @10:24AM (#32779638)
You shouldn't be downvoted, your question is reasonable even if it demonstrates a misunderstanding. So it's not a wrapper over WebGL, it's a more modern, lower-level GPU programming model. There are equivalent efforts in native environments to replace OpenGL - notably Vulkan and (Apple's) Metal.

As far as I understand, the approach allows far more flexibility, at the expense of higher complexity. It's less "stateful" than WebGL, which basically gives you a big class that manages everything OOP-style.

Re:Use.GPU by msk-lywenn on Friday September 09, 2022 @09:36AM (#32779039)
It's the other way around. WebGPU is to Vulkan what WebGL is to OpenGL. It's less low level than vulkan though.
Re:Use.GPU by incrudible on Friday September 09, 2022 @09:35AM (#32779029)
WebGPU is to WebGL as Vulkan is to OpenGL, a lower level, low overhead graphics API.