Skip to content

Conversation

@chrisdavidmills
Copy link
Contributor

Summary

From Chrome 140 onwards, calling GPUAdapter.requestDevice() multiple times on the same adapter causes the returned promise to reject. This is because the adapter is consumed by the first call. See https://developer.chrome.com/blog/new-in-webgpu-140#device_requests_consume_adapter.

Previously, you could call GPUAdapter.requestDevice() multiple times on the same adapter, but multiple calls would result in lost devices.

This PR tries to capture the old and new behavior in a single data point, rather than adding multiple data points for a behavior change, which would be rather odd. Let me know if you think this works, or if we should do it a different way.

Test results and supporting details

Related issues

@github-actions github-actions bot added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Nov 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@github-actions github-actions bot added the size:m [PR only] 25-100 LoC changed label Nov 6, 2025
@caugner caugner changed the title Chrome 140 GPUAdapter.requestDevice() consumes adapter Chrome 140 rejects duplicate requestDevice() calls on GPUDevice Nov 7, 2025
Comment on lines 375 to 377
"duplicate_calls_reject": {
"__compat": {
"description": "Lost `GPUDevice` returned on duplicate calls.",
"description": "Duplicate calls reject as adapter is consumed.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not totally sure about this feature, but maybe we can abstract from the specific behavior:

Suggested change
"duplicate_calls_reject": {
"__compat": {
"description": "Lost `GPUDevice` returned on duplicate calls.",
"description": "Duplicate calls reject as adapter is consumed.",
"handles_duplicate_calls": {
"__compat": {
"description": "Rejects duplicate calls as adapter is consumed.",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest commit.

@github-actions github-actions bot added size:s [PR only] 7-24 LoC changed and removed size:m [PR only] 25-100 LoC changed labels Nov 7, 2025
@github-actions github-actions bot added size:m [PR only] 25-100 LoC changed and removed size:s [PR only] 7-24 LoC changed labels Nov 7, 2025
@caugner caugner merged commit 299cbc0 into mdn:main Nov 7, 2025
6 checks passed
@mdn-bot mdn-bot mentioned this pull request Nov 7, 2025
@chrisdavidmills chrisdavidmills deleted the WebGPU-requestDevice-consumes-adapter branch November 7, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API size:m [PR only] 25-100 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants