← Back to release summary

WebGPU: GPUCanvasContext getConfiguration()

Category
Graphics
Type
New or changed feature
Status
Enabled by default (Chrome 131)
Intent stage
None

WPT details: WebGPU/WGSL have a conformance test suite (https://github.com/gpuweb/cts) that is regularly pulled into Chromium and part of the testing of Dawn/Tint in Chromium. While the CTS can be embedded in WPT, the WebGPU team opted to keep it separate in Chromium testing to use a customized harness for robustness and performance. All the tests about this feature in WebGPU CTS can be found through the below link: https://github.com/gpuweb/cts/pull/3973

Summary

Functionality added to the WebGPU spec after its first shipment in a browser. Once GPUCanvasContext configure() has been called with a configuration dictionary, the GPUCanvasContext getConfiguration() method lets developers check the canvas context configuration. It includes GPU device, format, usage, viewFormats, colorSpace, toneMapping, and alphaMode members. As discussed in https://github.com/gpuweb/gpuweb/issues/4828, web apps can use it to detect whether HDR canvas is supported in WebGPU.

Motivation

The GPUCanvasContext getConfiguration() method returns the canvas context configuration. https://github.com/gpuweb/gpuweb/pull/4899

Standards & signals

Ecosystem

View on chromestatus.com