Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add information to GPUQueue.submit() to say command buffers must be u… #36577

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chrisdavidmills
Copy link
Contributor

…nique

Description

In Chrome 126, the behavior of the GPUQueue.submit() method has been updated to be correct as per spec — the referenced command buffers must be unique.

This PR adds a line to state this in the parameter description, and a validation statement.

See https://developer.chrome.com/blog/new-in-webgpu-126#submitted_command_buffers_must_be_unique for the information source.

Motivation

Additional details

project issue: #36344

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner October 30, 2024 16:00
@chrisdavidmills chrisdavidmills requested review from wbamberg and removed request for a team October 30, 2024 16:00
@github-actions github-actions bot added Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed labels Oct 30, 2024
Copy link
Contributor

github-actions bot commented Oct 30, 2024

Preview URLs

(comment last updated: 2024-11-01 10:56:14)

@@ -22,7 +22,7 @@ submit(commandBuffers)
### Parameters

- `commandBuffers`
- : An array of {{domxref("GPUCommandBuffer")}} objects containing the commands to be enqueued for processing by the GPU.
- : An array of {{domxref("GPUCommandBuffer")}} objects containing the commands to be enqueued for processing by the GPU. The referenced `GPUCommandBuffer`s must be unique.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- : An array of {{domxref("GPUCommandBuffer")}} objects containing the commands to be enqueued for processing by the GPU. The referenced `GPUCommandBuffer`s must be unique.
- : An array of {{domxref("GPUCommandBuffer")}} objects containing the commands to be enqueued for processing by the GPU. The array must not contain duplicate command buffer objects.

(I thought "unique" was a bit hard to understand, maybe me. "unique within the array" maybe, but I thought "must not contain duplicates" would be better. Also I think pluralizing code-formatted identifiers makes them hard to read.)

Copy link
Contributor

Choose a reason for hiding this comment

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

We can also express it like that: each command buffer can only be submitted once.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the sentence to

The array must not contain duplicate GPUCommandBuffer objects — each one can only be submitted once.

But then I thought more about what you said, @beaufortfrancois — when you say "can only be submitted once", is that only once per submit() call, or once ever?

@@ -32,6 +32,7 @@ None ({{jsxref("Undefined")}}).

The following criteria must be met when calling **`submit()`**, otherwise a {{domxref("GPUValidationError")}} is generated and the {{domxref("GPUQueue")}} becomes invalid:

- The {{domxref("GPUCommandBuffer")}} objects referenced in the `submit()` call are unique.
Copy link
Collaborator

Choose a reason for hiding this comment

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

same, "contains duplicate" or "more than one instance of the same" would be clearer IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to

The array of {{domxref("GPUCommandBuffer")}} objects referenced in the submit() call does not contain duplicates.

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/xs [PR only] 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants