What's New in WebGPU (Chrome 114)

François Beaufort
François Beaufort

Optimize JavaScript

Chromium contributors sped up WebGPU performance for GPUComputePassEncoder, GPURenderPassEncoder, and GPUCommandEncoder methods by reducing the overhead of making calls from generated code in V8 JavaScript engine to C++ handlers in Blink rendering engine. See issue chromium:1417558.

The following microbenchmark shows CPU time of calls from JavaScript decreasing from around 0.5 ms per 10K draws to around 0.3 ms per 10K draws, which is a 40% improvement.

Screenshot of Chrome browser benchmark graph showing fast calls improvements.
Chrome benchmark graph showing fast calls improvements (source).

getCurrentTexture() on unconfigured canvas throws InvalidStateError

Calling GPUCanvasContext getCurrentTexture() method on an unconfigured canvas now throws InvalidStateError instead of OperationError according to the WebGPU spec. See issue chromium:1424461.

const context = document.querySelector("canvas").getContext("webgpu");
context.getCurrentTexture(); // Throws InvalidStateError

WGSL updates

Zero-filled vectors of AbstractInt can now be written as vec2(), vec3(), and vec4(). See issue tint:1892. For example:

  • vec2() is vec2(0,0)
  • vec3() is vec3(0,0,0)
  • vec4() is vec4(0,0,0,0)

Dawn updates

Improving error messages

Descriptor labels for invalid objects are not being dropped anymore so that you can see them in error messages. See issue dawn:1771.

Add missing APIs for Node.js

The GPUAdapter::requestAdapterInfo() and GPUBuffer::getMapState() methods are now implemented for Node.js. See issue dawn:1761.

What's New in WebGPU

A list of everything that has been covered in the What's New in WebGPU series.

Chrome 122

Chrome 121

Chrome 120

Chrome 119

Chrome 118

Chrome 117

Chrome 116

Chrome 115

Chrome 114

Chrome 113