Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 041fd02

Browse files
authored
Synchronization section: editing nits (gpuweb#607)
1 parent 7531dda commit 041fd02

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

spec/index.bs

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -414,14 +414,19 @@ Issue(gpuweb/gpuweb#514): Document read-only states for depth views.
414414

415415
## Synchronization ## {#programming-model-synchronization}
416416

417-
For each [=subresource=] of a [=physical resource=], the usage is tracked on the [=Queue timeline=].
417+
For each [=subresource=] of a [=physical resource=], its set of
418+
[=usage flags=] is tracked on the [=Queue timeline=].
419+
<dfn dfn>Usage flags</dfn> are {{GPUBufferUsage}} or {{GPUTextureUsage}} flags,
420+
according to the type of the subresource.
418421

419-
Issue: This section will need to be redacted to support multiple queues.
422+
Issue: This section will need to be revised to support multiple queues.
420423

421-
The [=Queue timeline=] could be split into a sequence of [=usage scopes=]:
422-
within each scope the usage of the [=subresource=] stays unchanged,
423-
and the implementation transitions the [=subresource=] to the new usage
424-
at the [=usage scope=] boundaries.
424+
On the [=Queue timeline=], there is an ordered sequence of [=usage scopes=].
425+
Each item on the timeline is contained within exactly one scope.
426+
For the duration of each scope, the set of [=usage flags=] of any given
427+
[=subresource=] is constant.
428+
A [=subresource=] may transition to new usages
429+
at the boundaries between [=usage scope=]s.
425430

426431
This specification defines the following [=usage scopes=]:
427432
1. an individual command on a {{GPUCommandEncoder}}, such as {{GPUCommandEncoder/copyBufferToTexture()|GPUCommandEncoder.copyBufferToTexture}}.
@@ -437,9 +442,9 @@ regarless of whether the indexed draw calls are used afterwards.
437442

438443
The [=usage scopes=] are validated at {{GPUCommandEncoder/finish()|GPUCommandEncoder.finish}} time.
439444
The implementation performs the <dfn dfn>usage scope validation</dfn> by composing
440-
the union of all usage flags of each [=subresources=] used in the [=usage scope=].
441-
A {{GPUValidationError}} is generated in the current scope with appropriate error message
442-
if that contains a [=mutating usage=] combined with any other usage.
445+
the set of all [=usage flags=] of each [=subresource=] used in the [=usage scope=].
446+
A {{GPUValidationError}} is generated in the current scope with an appropriate error message
447+
if that union contains a [=mutating usage=] combined with any other usage.
443448

444449
Core Internal Objects {#core-internal-objects}
445450
==============================================
@@ -1805,9 +1810,11 @@ A {{GPUBindGroup}} object has the following internal slots:
18051810
: <dfn>\[[entries]]</dfn> of type sequence<{{GPUBindGroupEntry}}>.
18061811
::
18071812
The set of {{GPUBindGroupEntry}}s this {{GPUBindGroup}} describes.
1813+
18081814
: <dfn>\[[usedBuffers]]</dfn> of type maplike<{{GPUBuffer}}, {{GPUBufferUsage}}>.
18091815
::
18101816
The set of buffers used by this bind group and the corresponding usage flags.
1817+
18111818
: <dfn>\[[usedTextures]]</dfn> of type maplike<{{GPUTexture}} [=subresource=], {{GPUTextureUsage}}>.
18121819
::
18131820
The set of texure subresources used by this bind group. Each subresource is
@@ -1856,8 +1863,8 @@ The <dfn method for="GPUDevice">createBindGroup(|descriptor|)</dfn> method is us
18561863
1. Return a new {{GPUBindGroup}} object with:
18571864
- {{GPUBindGroup/[[layout]]}} = |descriptor|.{{GPUBindGroupDescriptor/layout}}
18581865
- {{GPUBindGroup/[[entries]]}} = |descriptor|.{{GPUBindGroupDescriptor/entries}}
1859-
- {{GPUBindGroup/[[usedBuffers]]}} = union of the buffer usages across the entries
1860-
- {{GPUBindGroup/[[usedTextures]]}} = union of the texture subresources usages across the entries
1866+
- {{GPUBindGroup/[[usedBuffers]]}} = union of the buffer usages across all entries
1867+
- {{GPUBindGroup/[[usedTextures]]}} = union of the texture [=subresource=] usages across all entries
18611868

18621869
<b>Validation Conditions</b>
18631870

@@ -1881,25 +1888,25 @@ If any of the following conditions are violated:
18811888
|view|'s texture's {{GPUTextureDescriptor/sampleCount}} must be 1.
18821889
1. If |layoutBinding|.{{GPUBindGroupLayoutEntry/type}} is
18831890
{{GPUBindingType/"sampled-texture"}}, |view|'s texture's {{GPUTextureDescriptor/usage}}
1884-
must include {{GPUTextureUsage/SAMPLED}}. Each texture's [=subresource=] seen by the |view|
1891+
must include {{GPUTextureUsage/SAMPLED}}. Each texture [=subresource=] seen by |view|
18851892
is added to {{GPUBindGroup/[[usedTextures]]}} with {{GPUTextureUsage/SAMPLED}} flag.
18861893
1. If |layoutBinding|.{{GPUBindGroupLayoutEntry/type}} is
18871894
{{GPUBindingType/"readonly-storage-texture"}} or {{GPUBindingType/"writeonly-storage-texture"}},
18881895
|view|'s texture's {{GPUTextureDescriptor/usage}} must include {{GPUTextureUsage/STORAGE}}.
1889-
Each texture's [=subresource=] seen by the |view|
1896+
Each texture [=subresource=] seen by |view|
18901897
is added to {{GPUBindGroup/[[usedTextures]]}} with {{GPUTextureUsage/STORAGE}} flag.
18911898

18921899
<dfn>buffer binding validation</dfn>: Let |bufferBinding| be
18931900
|bindingDescriptor|.{{GPUBindGroupEntry/resource}}, a {{GPUBufferBinding}}.
18941901
This |layoutBinding| must be compatible with this |bufferBinding|. This requires:
18951902
1. If |layoutBinding|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"uniform-buffer"}},
18961903
the |bufferBinding|.{{GPUBufferBinding/buffer}}'s {{GPUBufferDescriptor/usage}} must include
1897-
{{GPUBufferUsage/UNIFORM}}. The buffer is added to {{GPUBindGroup/[[usedBuffers]]}} map
1904+
{{GPUBufferUsage/UNIFORM}}. The buffer is added to the {{GPUBindGroup/[[usedBuffers]]}} map
18981905
with {{GPUBufferUsage/UNIFORM}} flag.
18991906
1. If |layoutBinding|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"storage-buffer"}}
19001907
or {{GPUBindingType/"readonly-storage-buffer"}}, the
19011908
|bufferBinding|.{{GPUBufferBinding/buffer}}'s {{GPUBufferDescriptor/usage}} must include
1902-
{{GPUBufferUsage/STORAGE}}. The buffer is added to {{GPUBindGroup/[[usedBuffers]]}} map
1909+
{{GPUBufferUsage/STORAGE}}. The buffer is added to the {{GPUBindGroup/[[usedBuffers]]}} map
19031910
with {{GPUBufferUsage/STORAGE}} flag.
19041911
1. The bound part designated by |bufferBinding|.{{GPUBufferBinding/offset}} and
19051912
|bufferBinding|.{{GPUBufferBinding/size}} must reside inside the buffer.

0 commit comments

Comments
 (0)