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
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion files/en-us/web/api/gpuqueue/submit/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?


### Return value

Expand All @@ -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.

- Any {{domxref("GPUBuffer")}}, {{domxref("GPUTexture")}}, and {{domxref("GPUQuerySet")}} objects used in the encoded commands are available for use, i.e. not unavailable (`GPUBuffer`s are unavailable if they are currently {{domxref("GPUBuffer.mapAsync", "mapped", "", "nocode")}}) or destroyed (with the `destroy()` method).
- Any {{domxref("GPUExternalTexture")}} objects used in the encoded commands are not expired (they expire automatically shortly after being imported via {{domxref("GPUDevice.importExternalTexture", "importExternalTexture()")}}).
- If a {{domxref("GPUQuerySet")}} object used in an encoded command is of type `"occlusion"` query, it is not already used, except by {{domxref("GPURenderPassEncoder.beginOcclusionQuery()")}}.
Expand Down