Skip to content

Conversation

@chrisdavidmills
Copy link
Contributor

Description

In Chrome 138, the size requirements for GPUBuffers mapped at creation have changed. During a GPUDevice.createBuffer() call, if mappedAtCreation is set true and size is not a multiple of 4, a RangeError exception is thrown.

See https://developer.chrome.com/blog/new-in-webgpu-138#size_requirement_changes_for_buffers_mapped_at_creation.

This PR adds a mention of the change. cc @beaufortfrancois.

Question — if the RangeError is thrown, will an invalid GPUBuffer object still be returned? If not, should I remove the corresponding entry from the validation section?

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner October 16, 2025 14:00
@chrisdavidmills chrisdavidmills requested review from wbamberg and removed request for a team October 16, 2025 14:00
@github-actions github-actions bot added the Content:WebAPI Web API docs label Oct 16, 2025
@chrisdavidmills chrisdavidmills changed the title Document size requirement changes for GPUBuffers mapped at creation Technical review: Document size requirement changes for GPUBuffers mapped at creation Oct 16, 2025
@github-actions github-actions bot added the size/s [PR only] 6-50 LoC changed label Oct 16, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2025

Preview URLs

(comment last updated: 2025-10-17 13:15:54)

@beaufortfrancois
Copy link
Contributor

Question — if the RangeError is thrown, will an invalid GPUBuffer object still be returned? If not, should I remove the corresponding entry from the validation section?

When RangeError is thrown, there's no GPUBuffer returned. Yes, you should remove the corresponding entry from the validation section.

Copy link
Contributor

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

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

LGTM with comments

@chrisdavidmills
Copy link
Contributor Author

Question — if the RangeError is thrown, will an invalid GPUBuffer object still be returned? If not, should I remove the corresponding entry from the validation section?

When RangeError is thrown, there's no GPUBuffer returned. Yes, you should remove the corresponding entry from the validation section.

Ah ha, thought so ;-)

@chrisdavidmills chrisdavidmills changed the title Technical review: Document size requirement changes for GPUBuffers mapped at creation Editorial review: Document size requirement changes for GPUBuffers mapped at creation Oct 17, 2025
Copy link
Member

@pepelsbey pepelsbey left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you :)

@chrisdavidmills chrisdavidmills merged commit 60457fe into mdn:main Oct 17, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants