W3C consortium introduced the first draft specification versions WebGPU and WebPu Shading Language (WGSL) defining the API to perform operations on the GPU, such as rendering and calculations, as well as the language of the shaders for writing programs running on the GPU side. Conceptually similar to API Vulkan, Metal and Direct3D 12 . Specifications are prepared by the Working Group, which includes engineers from Mozilla, Google, Apple and Microsoft.
Conceptually WEBGPU differs from WebGl about the same way as the Vulkan graphic API differs from OpenGL, but it is not based on a specific graphic API, and is a universal layer using the same low-level primitives that are available in Vulkan, Metal and Direct3D . WebGPU provides JavaScript applications tools for low-level control over the organization, processing and transmission of commands to the GPU, the management of associated resources, memory, buffers, texture objects and compiled graphic shaders. Such an approach allows to achieve higher performance of graphic applications by reducing overhead and increase efficiency with GPU.
WebGPU makes it possible to create complex 3D-projects for WEB, working no worse than separate programs directly accessing Vulkan, Metal or Direct3D, but not tied to specific platforms. WebGPU also provides additional possibilities when porting native graphic programs into a form capable of working on the basis of Web technologies, thanks to the compilation in Webassembly. In addition to 3D schedules, the WebGPU covers and the possibilities associated with the removal of calculations on the side of the GPU and the execution of shaders.
Key features of WebGPU:
- separate resource management, preparatory work and transmission of commands in the GPU (one object in WebGL has answered once). There are three separate contexts: Gpudevice to create resources, such as textures and buffers; Gpucommandencoder for encoding individual commands, including rendering and calculation stages; GPUCOMMANDBUFFER for transmitting queue to execution in the GPU. The result can be drawn in a region associated with one or more canvas elements, or processed without output (for example, when starting computing tasks). The separation of stages simplifies the separation of resource creation and preparatory operations in different handlers that can be performed in different threads.