Skip to content

Commit

Permalink
[editorial] Make GPUCommandBuffer one-time-use
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x authored and toji committed Jun 29, 2022
1 parent d3f7f62 commit 99205e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions design/CommandSubmission.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Command Submission

**THIS DOCUMENT IS OUTDATED**

Command buffers carry sequences of user commands on the CPU side.
They can be recorded independently of the work done on GPU, or each other.
They go through the following stages:
Expand Down
10 changes: 9 additions & 1 deletion spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ may become unusable, e.g. if the owning device is [=lose the device|lost=] or
like buffer state [=buffer state/destroyed=].

[=Internal objects=] of some types *can* become [=invalid=] after they are created; specifically,
[=devices=], [=adapters=], and command/pass/bundle encoders.
[=devices=], [=adapters=], {{GPUCommandBuffer}}s, and command/pass/bundle encoders.

<div algorithm>
A given {{GPUObjectBase}} |object| is <dfn abstract-op>valid to use with</dfn>
Expand Down Expand Up @@ -7702,6 +7702,9 @@ Command buffers are pre-recorded lists of [=GPU commands=] that can be submitted
for execution. Each <dfn dfn>GPU command</dfn> represents a task to be performed on the GPU, such as
setting state, drawing, copying resources, etc.

A {{GPUCommandBuffer}} can only be submitted once, at which point it becomes [=invalid=].
To reuse rendering commands across multiple submissions, use {{GPURenderBundle}}.

## <dfn interface>GPUCommandBuffer</dfn> ## {#command-buffer}

<script type=idl>
Expand Down Expand Up @@ -10894,6 +10897,8 @@ GPUQueue includes GPUObjectBase;
::
Schedules the execution of the command buffers by the GPU on this queue.

Submitted command buffers cannot be used again.

<div algorithm=GPUQueue.submit>
**Called on:** {{GPUQueue}} this.

Expand All @@ -10918,6 +10923,9 @@ GPUQueue includes GPUObjectBase;
does.
</div>

1. For each |commandBuffer| in |commandBuffers|:
1. Make |commandBuffer| [=invalid=].

1. Issue the following steps on the [=Queue timeline=] of |this|:
<div class=queue-timeline>
1. For each |commandBuffer| in |commandBuffers|:
Expand Down

0 comments on commit 99205e6

Please sign in to comment.