Firefox and Safari to Get WebGPU Support

Mozilla has decided to enable support for the WebGPU API and WGSL (WebGPU Shading Language) in Firefox. For the platform Windows WebGPU support will be enabled by default in Firefox 141, scheduled for July 22. WebGPU support is then planned to be enabled in builds for the following months: Linux и macOS, and after some time in the version for the platform AndroidTo manually enable WebGPU, you can use the "dom.webgpu.enabled" and "gfx.webrender.all" parameters on the about:config page.

In Chrome, WebGPU support was offered by default in version 113, released in May 2023. In Safari, WebGPU support is planned to be enabled by default this fall (experimental support has been available since November 2021). In Firefox, experimental WebGPU support has been present since 2020, but was only enabled by default in nightly builds of Firefox. Firefox's WebGPU implementation is based on the WGPU project code, written in Rust and capable of running on top of the Direct3D 12, Vulkan, OpenGL, and Metal graphics APIs.

WebGPU provides a similar API to Vulkan, Metal, and Direct3D 12 for performing operations on the GPU side. In addition to 3D graphics, WebGPU also covers capabilities related to offloading calculations to the GPU side and executing shaders. Conceptually, WebGPU differs from the old WebGL specification in much the same way that the Vulkan graphics API differs from OpenGL. At the same time, WebGPU is not based on a specific graphics API, but is a universal layer that uses the same low-level primitives that are available in Vulkan, Metal, and Direct3D.

WebGPU enables JavaScript applications to control the organization, processing, and transmission of commands to the GPU, and manage associated resources, memory, buffers, texture objects, and compiled graphics shaders. This approach enables higher performance of graphics applications by reducing overhead and increasing the efficiency of working with the GPU.

With WebGPU, you can create platform-agnostic, complex 3D projects that perform as well as standalone programs that directly use Vulkan, Metal, or Direct3D. WebGPU also provides additional capabilities for porting native graphics programs to a form that can run in browsers, thanks to compilation to WebAssembly.

Key features of WebGPU and differences from WebGL:

  • Separate management of resources, preparatory work and transmission of commands to the GPU (in WebGL, one object was responsible for everything at once). Three separate contexts are provided: GPUDevice for creating resources such as textures and buffers; GPUCommandEncoder for encoding individual commands, including the rendering and calculation stages; GPUCommandBuffer to pass to the GPU run queue. The result can be rendered in an area associated with one or more canvas elements, or processed without output (for example, when running computational tasks). The separation of stages makes it easier to separate resource creation and provisioning operations into different handlers that can run on different threads.
  • A different approach to handling states. WebGPU provides two objects - GPURenderPipeline and GPUComputePipeline, which allow you to combine different states predefined by the developer, which makes it possible for the browser to not waste resources on additional work, such as recompiling shaders. Supported states include: shaders, vertex buffer and attribute layouts, sticky group layouts, blending, depth and patterns, post-render output formats.
  • A binding model, much like Vulkan's resource grouping tools. To group resources into groups, the WebGPU provides a GPUBindGroup object, which, at the time of writing commands, can be associated with other similar objects for use in shaders. Creating such groups allows the driver to perform the necessary preparatory actions in advance, and allows the browser to change resource bindings between draw calls much faster. The layout of resource bindings can be predefined using the GPUBindGroupLayout object.

Source: opennet.ru

Buy reliable hosting for sites with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster