-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
base: main
Are you sure you want to change the base?
Add information to GPUQueue.submit() to say command buffers must be u… #36577
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- : 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.)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…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