@@ -414,14 +414,19 @@ Issue(gpuweb/gpuweb#514): Document read-only states for depth views.
414
414
415
415
## Synchronization ## {#programming-model-synchronization}
416
416
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.
418
421
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.
420
423
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.
425
430
426
431
This specification defines the following [=usage scopes=] :
427
432
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.
437
442
438
443
The [=usage scopes=] are validated at {{GPUCommandEncoder/finish()|GPUCommandEncoder.finish}} time.
439
444
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.
443
448
444
449
Core Internal Objects {#core-internal-objects}
445
450
==============================================
@@ -1805,9 +1810,11 @@ A {{GPUBindGroup}} object has the following internal slots:
1805
1810
: <dfn>\[[entries]]</dfn> of type sequence<{{GPUBindGroupEntry}} >.
1806
1811
::
1807
1812
The set of {{GPUBindGroupEntry}} s this {{GPUBindGroup}} describes.
1813
+
1808
1814
: <dfn>\[[usedBuffers]]</dfn> of type maplike<{{GPUBuffer}} , {{GPUBufferUsage}} >.
1809
1815
::
1810
1816
The set of buffers used by this bind group and the corresponding usage flags.
1817
+
1811
1818
: <dfn>\[[usedTextures]]</dfn> of type maplike<{{GPUTexture}} [=subresource=] , {{GPUTextureUsage}} >.
1812
1819
::
1813
1820
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
1856
1863
1. Return a new {{GPUBindGroup}} object with:
1857
1864
- {{GPUBindGroup/[[layout]]}} = |descriptor|.{{GPUBindGroupDescriptor/layout}}
1858
1865
- {{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
1861
1868
1862
1869
<b> Validation Conditions</b>
1863
1870
@@ -1881,25 +1888,25 @@ If any of the following conditions are violated:
1881
1888
|view|'s texture' s {{GPUTextureDescriptor/sampleCount}} must be 1.
1882
1889
1. If |layoutBinding|.{{GPUBindGroupLayoutEntry/type}} is
1883
1890
{{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|
1885
1892
is added to {{GPUBindGroup/[[usedTextures]]}} with {{GPUTextureUsage/SAMPLED}} flag.
1886
1893
1. If |layoutBinding|.{{GPUBindGroupLayoutEntry/type}} is
1887
1894
{{GPUBindingType/"readonly-storage-texture"}} or {{GPUBindingType/"writeonly-storage-texture"}} ,
1888
1895
|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|
1890
1897
is added to {{GPUBindGroup/[[usedTextures]]}} with {{GPUTextureUsage/STORAGE}} flag.
1891
1898
1892
1899
<dfn>buffer binding validation</dfn> : Let |bufferBinding| be
1893
1900
|bindingDescriptor|.{{GPUBindGroupEntry/resource}} , a {{GPUBufferBinding}} .
1894
1901
This |layoutBinding| must be compatible with this |bufferBinding|. This requires:
1895
1902
1. If |layoutBinding|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"uniform-buffer"}} ,
1896
1903
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
1898
1905
with {{GPUBufferUsage/UNIFORM}} flag.
1899
1906
1. If |layoutBinding|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"storage-buffer"}}
1900
1907
or {{GPUBindingType/"readonly-storage-buffer"}} , the
1901
1908
|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
1903
1910
with {{GPUBufferUsage/STORAGE}} flag.
1904
1911
1. The bound part designated by |bufferBinding|.{{GPUBufferBinding/offset}} and
1905
1912
|bufferBinding|.{{GPUBufferBinding/size}} must reside inside the buffer.
0 commit comments