WebGPU

Last updated
WebGPU
Year started18 May 2021 (2021-05-18)
First published18 May 2021 (2021-05-18)
Latest versionW3C Working Draft
(As of 2023) ((As of 2023))
Organization W3C
Committee
  • GPU for the Web WG
  • GPU for the Web CG
Editors
  • Justin Fan
  • Brandon Jones
  • Dzmitry Malyshau
  • Myles C. Maxfield
  • Kai Ninomiya
Related standards
Domain
Website www.w3.org/TR/webgpu/

WebGPU is a JavaScript API provided by a web browser that enables webpage scripts to efficiently utilize a device's graphics processing unit (GPU). This is achieved with the underlying Vulkan, Metal, or Direct3D 12 system APIs. On relevant devices, WebGPU is intended to supersede the older WebGL standard. [1]

Contents

Google Chrome enabled initial WebGPU support in April 2023. [1] [2] Safari and Firefox have not yet enabled theirs. [2] The W3C standard is thus in the working draft phase.

Technology

WebGPU enables 3D graphics within an HTML canvas. It also has robust support for general-purpose GPU computations. [3]

WebGPU uses its own shading language called WGSL that was designed to be trivially translatable to SPIR-V, until complaints caused redirection into a more traditional design, similar to other shading languages. The syntax is similar to Rust. [4] Tint is a Google-made compiler for WGSL. [5] Naga is a similar project developed for the needs of wgpu-rs. [6]

Implementations

Both Google Chrome and Firefox support WebGPU with SPIR-V, with work ongoing for the WGSL front-end. Firefox and Deno use the Rust wgpu library. [7] Safari follows upstream specifications of both WebGPU and WGSL. [2]

Chrome version 113 enabled initial WebGPU support on Windows devices with Direct3D 12, ChromeOS devices with Vulkan, and macOS with Metal. [1] This support for Android was enabled in version 121. [2]

History

On June 8, 2016, Google showed "Explicit web graphics API" presentation to the WebGL working group (during the bi-annual face to face meeting). [8] The presentation explored the basic ideas and principles of building a new API to eventually replace WebGL, aka "WebGL Next".

On January 24, 2017, Khronos hosted an IP-free meeting dedicated to discussion of "WebGL Next" ideas, collided with WebGL working group meeting in Vancouver. [9] Google team presented the NXT prototype implementing a new API that could run in Chromium with OpenGL, or standalone with OpenGL and Metal. NXT borrowed concepts from all of Vulkan, Direct3D 12, and Metal native APIs. Apple and Mozilla representatives also showed their prototypes built on Safari and Servo correspondingly, both of which closely replicated the Metal API.

On February 7, 2017, Apple's WebKit team proposed the creation of the W3C community group to design the API. At the same time they announced a technical proof of concept and proposal under the name "WebGPU", based on concepts in Apple's Metal. [10] [11] [12] The WebGPU name was later adopted by the community group as a working name for the future standard rather than just Apple's initial proposal. [13] The initial proposal has been renamed to "WebMetal" to avoid further confusion. [14]

The W3C "GPU for the Web" Community Group was launched on February 16, 2017. At this time, all of Apple, Google, and Mozilla had experiments in the area, but only Apple's proposal was officially submitted to the "gpuweb-proposals" repository. [15] [16] [17] Shortly after, on March 21, 2017, Mozilla submitted a proposal for WebGL Next within Khronos repository, based on the Vulkan design. [18] [19]

On June 1, 2018, citing "resolution on most-high level issues" in the cross-browser standardization effort, Google's Chrome team announced intent to implement the future WebGPU standard. [13]

Related Research Articles

<span class="mw-page-title-main">OpenGL</span> Cross-platform graphics API

OpenGL is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.

Gecko is a browser engine developed by Mozilla. It is used in the Firefox browser, the Thunderbird email client, and many other projects.

<span class="mw-page-title-main">Shader</span> Type of program in a graphical processing unit (GPU)

In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene—a process known as shading. Shaders have evolved to perform a variety of specialized functions in computer graphics special effects and video post-processing, as well as general-purpose computing on graphics processing units.

<span class="mw-page-title-main">OpenGL ES</span> Subset of the OpenGL API for embedded systems

OpenGL for Embedded Systems is a subset of the OpenGL computer graphics rendering application programming interface (API) for rendering 2D and 3D computer graphics such as those used by video games, typically hardware-accelerated using a graphics processing unit (GPU). It is designed for embedded systems like smartphones, tablet computers, video game consoles and PDAs. OpenGL ES is the "most widely deployed 3D graphics API in history".

A shading language is a graphics programming language adapted to programming shader effects. Shading languages usually consist of special data types like "vector", "matrix", "color" and "normal".

<span class="mw-page-title-main">OpenGL Shading Language</span> High-level shading language

OpenGL Shading Language (GLSL) is a high-level shading language with a syntax based on the C programming language. It was created by the OpenGL ARB to give developers more direct control of the graphics pipeline without having to use ARB assembly language or hardware-specific languages.

The canvas element is part of HTML5 and allows for dynamic, scriptable rendering of 2D shapes and bitmap images. It is a low level, procedural model that updates a bitmap. HTML5 Canvas also helps in making 2D games.

Adreno is a series of graphics processing unit (GPU) semiconductor intellectual property cores developed by Qualcomm and used in many of their SoCs.

Web3D, also called 3D Web, is a group of technologies to display and navigate websites using 3D computer graphics.

Direct2D is a 2D vector graphics application programming interface (API) designed by Microsoft and implemented in Windows 10, Windows 8, Windows 7 and Windows Server 2008 R2, and also Windows Vista and Windows Server 2008.

<span class="mw-page-title-main">Skia Graphics Engine</span> Open source graphics library written in C++

The Skia Graphics Engine or Skia is an open-source 2D graphics library written in C++. Skia abstracts away platform-specific graphics APIs. Skia Inc. originally developed the library; Google acquired it in 2005, and then released the software as open source licensed under the New BSD free software license in 2008.

<span class="mw-page-title-main">WebGL</span> JavaScript bindings for OpenGL in web browsers

WebGL is a JavaScript API for rendering interactive 2D and 3D graphics within any compatible web browser without the use of plug-ins. WebGL is fully integrated with other web standards, allowing GPU-accelerated usage of physics, image processing, and effects in the HTML canvas. WebGL elements can be mixed with other HTML elements and composited with other parts of the page or page background.

The Indexed Database API is a JavaScript application programming interface (API) provided by web browsers for managing a NoSQL database of objects. It is a standard maintained by the World Wide Web Consortium (W3C).

HTML audio is a subject of the HTML specification, incorporating audio input, playback, and synthesis, as well as speech to text, all in the browser.

<span class="mw-page-title-main">Mantle (API)</span> Low-overhead rendering API

Mantle was a low-overhead rendering API targeted at 3D video games. AMD originally developed Mantle in cooperation with DICE, starting in 2013. Mantle was designed as an alternative to Direct3D and OpenGL, primarily for use on personal computers, although Mantle supports the GPUs present in the PlayStation 4 and in the Xbox One. In 2015, Mantle's public development was suspended and in 2019 completely discontinued, as DirectX 12 and the Mantle-derived Vulkan rose in popularity.

ANGLE is an open source, cross-platform graphics engine abstraction layer developed by Google. ANGLE translates OpenGL ES 2/3 calls to DirectX 9, 11, OpenGL or Vulkan API calls. It is a portable version of OpenGL but with limitations of OpenGL ES standard.

<span class="mw-page-title-main">Metal (API)</span> iOS, macOS, and tvOS graphics rendering API

Metal is a low-level, low-overhead hardware-accelerated 3D graphic and compute shader API created by Apple, debuting in iOS 8. Metal combines functions similar to OpenGL and OpenCL in one API. It is intended to improve performance by offering low-level access to the GPU hardware for apps on iOS, iPadOS, macOS, and tvOS. It can be compared to low-level APIs on other platforms such as Vulkan and DirectX 12.

Vulkan is a low-level, low-overhead cross-platform API and open standard for 3D graphics and computing. It was intended to address the shortcomings of OpenGL, and allow developers more control over the GPU. It is designed to support a wide variety of GPUs, CPUs and operating systems, and it is also designed to work with modern multi-core CPUs.

WebXR Device API is a Web application programming interface (API) that describes support for accessing augmented reality and virtual reality devices, such as the HTC Vive, Oculus Rift, Oculus Quest, Google Cardboard, HoloLens, Apple Vision Pro, Magic Leap or Open Source Virtual Reality (OSVR), in a web browser. The WebXR Device API and related APIs are standards defined by W3C groups, the Immersive Web Community Group and Immersive Web Working Group. While the Community Group works on the proposals in the incubation period, the Working Group defines the final web specifications to be implemented by the browsers.

References

  1. 1 2 3 "Chrome ships WebGPU". Chrome Developers. Retrieved 2023-04-08.
  2. 1 2 3 4 "WebGPU Implementation Status". GitHub. Retrieved 14 March 2024.
  3. "WebGPU API". developer.mozilla.org. Retrieved 17 March 2024.
  4. WebGPU Shading Language specification
  5. Tint source code
  6. Naga source code
  7. wgpu, Rust Graphics Mages, 2024-01-03, retrieved 2024-01-03
  8. Wallez, Corentin. "Explicit web graphics API" . Retrieved 2019-06-25.
  9. Wallez, Corentin; Ninomiya, Kai. "WebGL Next investigations" . Retrieved 2019-06-25.
  10. "Next-generation 3D Graphics on the Web". WebKit. 2017-02-07. Retrieved 2018-08-13.
  11. "Apple seeks to position Metal as part of new 3D graphics standard for web". AppleInsider. Retrieved 2018-08-13.
  12. Claburn, Thomas (2017-02-08). "Web-standards-allergic Apple unveils WebGPU, a web graphics standard". The Register . Retrieved 2017-08-14.
  13. "WebGPU Prototype and Demos". WebKit. 2017-04-05. Retrieved 2019-01-10.
  14. Jackson, Dean (2017-02-16). "Welcome and Getting Started". public-gpu (Mailing list). Retrieved 2018-09-11.
  15. Jackson, Dean. "Add Apple's WebGPU proposal". GitHub . Retrieved 2019-03-08.
  16. Malyshau, Dzmitry. "Prototyping a new 3D API for the Web" . Retrieved 2016-12-16.
  17. Malyshau, Dzmitry (2017-03-21). "Defining the Web platform" . Retrieved 2018-09-11.
  18. Malyshau, Dzmitry. "Mozilla's contribution: Obsidian API". GitHub . Retrieved 2019-03-08.