Intent to ship: WebGPU: GPUCanvasContext getConfiguration()

297 views
Skip to first unread message

François Beaufort

unread,
Oct 2, 2024, 12:51:28 AM10/2/24
to blink-dev

Contact emails

fbea...@google.com

Explainer

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


Specification

https://gpuweb.github.io/gpuweb/#dom-gpucanvascontext-getconfiguration

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.



Blink component

Blink>WebGPU

TAG review

None

TAG review status

Pending

Risks



Interoperability and Compatibility

This feature has not yet been implemented in any browser. It has been approved by the GPU for the Web Community Group, with representatives from Chrome, Firefox, and Safari. See minutes at https://github.com/gpuweb/gpuweb/wiki/GPU-Web-2024-09-18#m1-feature-detection-for-hdr-canvas-4828



Gecko: No signal Mozilla members have requested during weekly standardization meetings that we postpone filing standard positions until we reach Candidate Recommendation (CR) status in Q4.

WebKit: Positive (https://github.com/WebKit/standards-positions/issues/294#issuecomment-1877411933)

Web developers: Positive https://github.com/gpuweb/gpuweb/issues/4828#issuecomment-2330181314

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

No

All platforms will eventually have support. Will immediately be available on Android, Android WebView, ChromeOS, Mac, and Windows, since those platforms already support WebGPU. Linux is planned to have WebGPU support in the future, so this feature will become available when WebGPU does.



Is this feature fully tested by web-platform-tests?

Yes

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



Flag name on chrome://flags

chrome://flags/#enable-unsafe-webgpu

Finch feature name

WebGPU.Enabled:UnsafeFeatures

Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/370109829

Estimated milestones

Shipping on desktop131
Shipping on Android131


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6195110870777856?gate=5109106965479424

This intent message was generated by Chrome Platform Status.

Yoav Weiss (@Shopify)

unread,
Oct 8, 2024, 3:06:43 AM10/8/24
to blink-dev, François Beaufort
LGTM1 (from the right account)

Chris Harrelson

unread,
Oct 8, 2024, 10:38:38 AM10/8/24
to Yoav Weiss (@Shopify), blink-dev, François Beaufort
LGTM2

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/435c5a35-dac1-4ff9-b3b6-5151d40d33b5n%40chromium.org.

Vladimir Levin

unread,
Oct 9, 2024, 11:50:25 AM10/9/24
to Chris Harrelson, Yoav Weiss (@Shopify), blink-dev, François Beaufort
Reply all
Reply to author
Forward
0 new messages