Google this week announced the beta release of Chrome 94, the next update to Google’s desktop web browser. In addition to general improvements, the update also adds support for the new WebGPU API, which comes to replace WebGL and can even access Apple’s Metal API.
As described by Google in a blog post, WebGPU is a new, more advanced graphics API for the web that is able to access GPU hardware, resulting in better performance for rendering interfaces in websites and web apps.
The main difference of WebGPU to other graphics acceleration APIs for the web is that the new API is based on the device’s native technologies, such as Apple’s Metal, Microsoft’s Direct3D, or the open Vulkan standard. This should make it easier for web developers to create web apps and games with more intense graphics.
The WebGPU API is the successor to the WebGL and WebGL2 graphics APIs for the Web. It provides modern features such as “GPU compute” as well as lower overhead access to GPU hardware and better, more predictable performance. This is an improvement over the existing WebGL interfaces, which were designed for drawing images but could only be repurposed for other kinds of computations with great effort.
For those unfamiliar, Metal is an API introduced by Apple in 2014 that provides low-level access to GPU hardware for iOS, macOS, and tvOS apps. In other words, apps can access the GPU without overloading the CPU, which is one of the limitations of old APIs like OpenGL.
However, as noted by The Verge, it will probably take some time before developers adopt the new WebGPU API into their web projects as it’s still considered an experimental feature. Google says WebGPU is not expected to come enabled by default for all Chrome users until early 2022.
The final release of Chrome 94 should enable WebCodecs for everyone, which is another API designed to improve the encoding and decoding of streaming videos.
Apple currently provides access to the WebGPU API in its Safari web browser through the latest version of the Safari Technology Preview, which can be downloaded by developers. Since the API is not yet included in Safari 15 that comes with macOS Monterey, it will probably come in early 2022 with a future Safari update.