← Back to release summary

WebGPU: GPUCanvasContext getConfiguration()

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

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

View on chromestatus.com