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

Skip to content

Commit 097aaf1

Browse files
committed
Merge branch 'main' into add-dual-source-blending
2 parents b914f26 + 266238c commit 097aaf1

File tree

10 files changed

+304
-233
lines changed

10 files changed

+304
-233
lines changed

.github/ISSUE_TEMPLATE/browser.md renamed to .github/ISSUE_TEMPLATE/1-browser.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ Instead, file a bug against the relevant browser.
1313
Chrome (or Dawn/Tint):
1414
Known issues:
1515
https://issues.chromium.org/savedsearches/6760928
16-
https://crbug.com/dawn
17-
https://crbug.com/tint
1816
To file a new issue:
19-
https://issues.chromium.org/issues/new?component=1456980
17+
https://issues.chromium.org/issues/new?noWizard=true&component=1456980
2018

2119
WebKit:
2220
https://bugs.webkit.org/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&component=WebGPU
File renamed without changes.

.github/ISSUE_TEMPLATE/3-webgpu.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: WebGPU API spec issue (not WGSL)
3+
about: 'API standardization/specification issue'
4+
title: ''
5+
labels: 'api'
6+
assignees: ''
7+
8+
---
File renamed without changes.

.github/ISSUE_TEMPLATE/5-other.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Misc, reference docs, wiki, etc.
3+
about: 'Something other than WebGPU/WGSL spec - reference docs, wiki, GitHub infra, etc.'
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---

.github/ISSUE_TEMPLATE/webgpu.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

spec/index.bs

Lines changed: 175 additions & 184 deletions
Large diffs are not rendered by default.

spec/sections/copies.bs

Lines changed: 97 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ dictionary GPUImageCopyBuffer
110110
copied, depending on the method it is being passed to.
111111
</dl>
112112

113-
<div algorithm class=validusage>
113+
<div algorithm data-timeline=device>
114114
<dfn abstract-op>validating GPUImageCopyBuffer</dfn>
115115

116116
**Arguments:**
@@ -119,9 +119,14 @@ dictionary GPUImageCopyBuffer
119119

120120
**Returns:** {{boolean}}
121121

122+
[=Device timeline=] steps:
123+
122124
1. Return `true` if and only if all of the following conditions are satisfied:
123-
- |imageCopyBuffer|.{{GPUImageCopyBuffer/buffer}} must be a [=valid=] {{GPUBuffer}}.
124-
- |imageCopyBuffer|.{{GPUImageDataLayout/bytesPerRow}} must be a multiple of 256.
125+
126+
<div class=validusage>
127+
- |imageCopyBuffer|.{{GPUImageCopyBuffer/buffer}} must be a [=valid=] {{GPUBuffer}}.
128+
- |imageCopyBuffer|.{{GPUImageDataLayout/bytesPerRow}} must be a multiple of 256.
129+
</div>
125130
</div>
126131

127132
<h4 id=gpuimagecopytexture data-dfn-type=dictionary>`GPUImageCopyTexture`
@@ -160,8 +165,8 @@ dictionary GPUImageCopyTexture {
160165
Defines which aspects of the {{GPUImageCopyTexture/texture}} to copy to/from.
161166
</dl>
162167

163-
<div algorithm class=validusage>
164-
<dfn abstract-op>validating GPUImageCopyTexture</dfn>
168+
<div algorithm data-timeline=device>
169+
<dfn abstract-op>validating GPUImageCopyTexture</dfn>(|imageCopyTexture|, |copySize|)
165170

166171
**Arguments:**
167172

@@ -170,19 +175,73 @@ dictionary GPUImageCopyTexture {
170175

171176
**Returns:** {{boolean}}
172177

178+
[=Device timeline=] steps:
179+
173180
1. Let |blockWidth| be the [=texel block width=] of |imageCopyTexture|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/format}}.
174181
1. Let |blockHeight| be the [=texel block height=] of |imageCopyTexture|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/format}}.
175182

176183
1. Return `true` if and only if all of the following conditions apply:
177-
- |imageCopyTexture|.{{GPUImageCopyTexture/texture}} must be a [=valid=] {{GPUTexture}}.
178-
- |imageCopyTexture|.{{GPUImageCopyTexture/mipLevel}} must be &lt;
179-
|imageCopyTexture|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/mipLevelCount}}.
180-
- |imageCopyTexture|.{{GPUImageCopyTexture/origin}}.[=GPUOrigin3D/x=] must be a multiple of |blockWidth|.
181-
- |imageCopyTexture|.{{GPUImageCopyTexture/origin}}.[=GPUOrigin3D/y=] must be a multiple of |blockHeight|.
182-
- The [=imageCopyTexture physical subresource size=] of |imageCopyTexture| is equal to |copySize| if either of
183-
the following conditions is true:
184-
- |imageCopyTexture|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/format}} is a depth-stencil format.
185-
- |imageCopyTexture|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/sampleCount}} &gt; 1.
184+
185+
<div class=validusage>
186+
- [$validating texture copy range$](|imageCopyTexture|, |copySize|) returns `true`.
187+
- |imageCopyTexture|.{{GPUImageCopyTexture/texture}} must be a [=valid=] {{GPUTexture}}.
188+
- |imageCopyTexture|.{{GPUImageCopyTexture/mipLevel}} must be &lt;
189+
|imageCopyTexture|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/mipLevelCount}}.
190+
- |imageCopyTexture|.{{GPUImageCopyTexture/origin}}.[=GPUOrigin3D/x=] must be a multiple of |blockWidth|.
191+
- |imageCopyTexture|.{{GPUImageCopyTexture/origin}}.[=GPUOrigin3D/y=] must be a multiple of |blockHeight|.
192+
- The [=imageCopyTexture physical subresource size=] of |imageCopyTexture| is equal to |copySize| if either of
193+
the following conditions is true:
194+
- |imageCopyTexture|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/format}} is a depth-stencil format.
195+
- |imageCopyTexture|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/sampleCount}} &gt; 1.
196+
</div>
197+
</div>
198+
199+
<div algorithm data-timeline=device>
200+
<dfn abstract-op>validating texture buffer copy</dfn>(|imageCopyTexture|, |dataLayout|, |dataLength|, |copySize|, |textureUsage|, |aligned|)
201+
202+
**Arguments:**
203+
204+
- {{GPUImageCopyTexture}} |imageCopyTexture|
205+
- {{GPUImageDataLayout}} |dataLayout|
206+
- {{GPUSize64Out}} |dataLength|
207+
- {{GPUExtent3D}} |copySize|
208+
- {{GPUTextureUsage}} |textureUsage|
209+
- {{boolean}} |aligned|
210+
211+
**Returns:** {{boolean}}
212+
213+
[=Device timeline=] steps:
214+
215+
1. Let |texture| be |imageCopyTexture|.{{GPUImageCopyTexture/texture}}
216+
1. Let |aspectSpecificFormat| = |texture|.{{GPUTexture/format}}.
217+
1. Let |offsetAlignment| = [=texel block copy footprint=] of |texture|.{{GPUTexture/format}}.
218+
219+
1. Return `true` if and only if all of the following conditions apply:
220+
221+
<div class=validusage>
222+
1. [$validating GPUImageCopyTexture$](|imageCopyTexture|, |copySize|) returns `true`.
223+
1. |texture|.{{GPUTexture/sampleCount}} is 1.
224+
1. |texture|.{{GPUTexture/usage}} contains |textureUsage|.
225+
1. If |texture|.{{GPUTexture/format}} is a [=depth-or-stencil format=] format:
226+
1. |imageCopyTexture|.{{GPUImageCopyTexture/aspect}} must refer to a single aspect of
227+
|texture|.{{GPUTexture/format}}.
228+
1. If |textureUsage| is:
229+
<dl class=switch>
230+
: {{GPUTextureUsage/COPY_SRC}}
231+
:: That aspect must be a valid image copy source according to [[#depth-formats]].
232+
233+
: {{GPUTextureUsage/COPY_DST}}
234+
:: That aspect must be a valid image copy destination according to [[#depth-formats]].
235+
</dl>
236+
1. Set |aspectSpecificFormat| to the [=aspect-specific format=] according to [[#depth-formats]].
237+
1. Set |offsetAlignment| to 4.
238+
1. If |aligned| is `true`:
239+
1. |dataLayout|.{{GPUImageDataLayout/offset}} is a multiple of |offsetAlignment|.
240+
1. [$validating linear texture data$](|dataLayout|,
241+
|dataLength|,
242+
|aspectSpecificFormat|,
243+
|copySize|) succeeds.
244+
</div>
186245
</div>
187246

188247
Issue(gpuweb/gpuweb#69): Define the copies with {{GPUTextureDimension/1d}} and {{GPUTextureDimension/3d}} textures.
@@ -263,7 +322,7 @@ dictionary GPUImageCopyExternalImage {
263322
The source of the [=image copy=]. The copy source data is captured at the moment that
264323
{{GPUQueue/copyExternalImageToTexture()}} is issued. Source size is defined by source
265324
type, given by this table:
266-
325+
267326
<table class=data>
268327
<thead>
269328
<tr>
@@ -302,7 +361,7 @@ dictionary GPUImageCopyExternalImage {
302361
<tr>
303362
<td>{{HTMLCanvasElement}} or {{OffscreenCanvas}} with {{ImageBitmapRenderingContext}}
304363
<td>{{ImageBitmapRenderingContext}}'s internal output bitmap
305-
{{ImageBitmap/width|ImageBitmap.width}},
364+
{{ImageBitmap/width|ImageBitmap.width}},
306365
{{ImageBitmap/height|ImageBitmap.height}}
307366
</tbody>
308367
</table>
@@ -324,7 +383,7 @@ dictionary GPUImageCopyExternalImage {
324383

325384
### Subroutines ### {#image-copies-subroutines}
326385

327-
<div algorithm="imageCopyTexture physical subresource size">
386+
<div algorithm="imageCopyTexture physical subresource size" data-timeline=const>
328387
<dfn dfn>imageCopyTexture physical subresource size</dfn>
329388

330389
**Arguments:**
@@ -340,7 +399,7 @@ dictionary GPUImageCopyExternalImage {
340399
|imageCopyTexture|.{{GPUImageCopyTexture/mipLevel}}.
341400
</div>
342401

343-
<div algorithm>
402+
<div algorithm data-timeline=device>
344403
<dfn abstract-op>validating linear texture data</dfn>(layout, byteSize, format, copyExtent)
345404

346405
**Arguments:**
@@ -354,6 +413,8 @@ dictionary GPUImageCopyExternalImage {
354413
: {{GPUExtent3D}} |copyExtent|
355414
:: Extent of the texture to copy.
356415

416+
[=Device timeline=] steps:
417+
357418
1. Let:
358419
- |widthInBlocks| be |copyExtent|.[=GPUExtent3D/width=] &divide; the [=texel block width=] of |format|.
359420
[=Assert=] this is an integer.
@@ -393,8 +454,8 @@ dictionary GPUImageCopyExternalImage {
393454
</div>
394455
</div>
395456

396-
<div algorithm class=validusage>
397-
<dfn dfn>validating texture copy range</dfn>
457+
<div algorithm data-timeline=device>
458+
<dfn abstract-op>validating texture copy range</dfn>
398459

399460
**Arguments:**
400461

@@ -403,31 +464,35 @@ dictionary GPUImageCopyExternalImage {
403464
: {{GPUExtent3D}} |copySize|
404465
:: The size of the texture.
405466

467+
[=Device timeline=] steps:
468+
406469
1. Let |blockWidth| be the [=texel block width=] of |imageCopyTexture|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/format}}.
407470
1. Let |blockHeight| be the [=texel block height=] of |imageCopyTexture|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/format}}.
408471
1. Let |subresourceSize| be the [=imageCopyTexture physical subresource size=] of |imageCopyTexture|.
409472
1. Return whether all the conditions below are satisfied:
410473

411-
- (|imageCopyTexture|.{{GPUImageCopyTexture/origin}}.[=GPUOrigin3D/x=] + |copySize|.[=GPUExtent3D/width=]) &le; |subresourceSize|.[=GPUExtent3D/width=]
412-
- (|imageCopyTexture|.{{GPUImageCopyTexture/origin}}.[=GPUOrigin3D/y=] + |copySize|.[=GPUExtent3D/height=]) &le; |subresourceSize|.[=GPUExtent3D/height=]
413-
- (|imageCopyTexture|.{{GPUImageCopyTexture/origin}}.[=GPUOrigin3D/z=] + |copySize|.[=GPUExtent3D/depthOrArrayLayers=]) &le; |subresourceSize|.[=GPUExtent3D/depthOrArrayLayers=]
414-
- |copySize|.[=GPUExtent3D/width=] must be a multiple of |blockWidth|.
415-
- |copySize|.[=GPUExtent3D/height=] must be a multiple of |blockHeight|.
416-
417-
Note:
418-
The texture copy range is validated against the *physical* (rounded-up)
419-
size for [=compressed formats=], allowing copies to access texture
420-
blocks which are not fully inside the texture.
474+
<div class=validusage>
475+
- (|imageCopyTexture|.{{GPUImageCopyTexture/origin}}.[=GPUOrigin3D/x=] + |copySize|.[=GPUExtent3D/width=]) &le; |subresourceSize|.[=GPUExtent3D/width=]
476+
- (|imageCopyTexture|.{{GPUImageCopyTexture/origin}}.[=GPUOrigin3D/y=] + |copySize|.[=GPUExtent3D/height=]) &le; |subresourceSize|.[=GPUExtent3D/height=]
477+
- (|imageCopyTexture|.{{GPUImageCopyTexture/origin}}.[=GPUOrigin3D/z=] + |copySize|.[=GPUExtent3D/depthOrArrayLayers=]) &le; |subresourceSize|.[=GPUExtent3D/depthOrArrayLayers=]
478+
- |copySize|.[=GPUExtent3D/width=] must be a multiple of |blockWidth|.
479+
- |copySize|.[=GPUExtent3D/height=] must be a multiple of |blockHeight|.
480+
481+
Note:
482+
The texture copy range is validated against the *physical* (rounded-up)
483+
size for [=compressed formats=], allowing copies to access texture
484+
blocks which are not fully inside the texture.
485+
</div>
421486
</div>
422487

423-
<div algorithm>
488+
<div algorithm data-timeline=const>
424489
Two {{GPUTextureFormat}}s |format1| and |format2| are <dfn dfn>copy-compatible</dfn> if:
425490

426491
- |format1| equals |format2|, or
427492
- |format1| and |format2| differ only in whether they are `srgb` formats (have the `-srgb` suffix).
428493
</div>
429494

430-
<div algorithm>
495+
<div algorithm data-timeline=const>
431496
The <dfn abstract-op>set of subresources for texture copy</dfn>(|imageCopyTexture|, |copySize|)
432497
is the subset of subresources of |texture| = |imageCopyTexture|.{{GPUImageCopyTexture/texture}}
433498
for which each subresource |s| satisfies the following:

wgsl/index.bs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,8 @@ The [=interpolation sampling=] names are:
14481448
* <a for="interpolation sampling" lt=center>`'center'`</a>
14491449
* <a for="interpolation sampling" lt=centroid>`'centroid'`</a>
14501450
* <a for="interpolation sampling" lt=sample>`'sample'`</a>
1451+
* <a for="interpolation sampling" lt=first>`'first'`</a>
1452+
* <a for="interpolation sampling" lt=either>`'either'`</a>
14511453

14521454
### Swizzle Names ### {#swizzle-names}
14531455

@@ -9552,7 +9554,6 @@ The <dfn export>interpolation type</dfn> [=shader-creation error|must=] be one o
95529554
:: Values are interpolated in a linear, non-perspective correct manner.
95539555
: <dfn for="interpolation type" export>flat</dfn>
95549556
:: Values are not interpolated.
9555-
Interpolation sampling is not used with `flat` interpolation.
95569557

95579558
The <dfn export>interpolation sampling</dfn> [=shader-creation error|must=] be one of the following
95589559
[=interpolation sampling name-token|interpolation sampling name=] [=tokens=]:
@@ -9566,18 +9567,24 @@ The <dfn export>interpolation sampling</dfn> [=shader-creation error|must=] be o
95669567
:: Interpolation is performed per sample.
95679568
The [=fragment=] shader is invoked once per sample when this attribute is
95689569
applied.
9570+
: <dfn for="interpolation sampling" export>first</dfn>
9571+
:: The value is provided by the first vertex of the primitive.
9572+
: <dfn for="interpolation sampling" export>either</dfn>
9573+
:: The value is provided by the first vertex or last vertex of the primitive.
9574+
Whether the value comes from the first or last vertex is implementation dependent.
95699575

95709576
For user-defined IO of scalar or vector floating-point type:
95719577
* If the interpolation attribute is not specified, then `@interpolate(perspective, center)` is assumed.
95729578
* If the interpolation attribute is specified with an interpolation type:
9573-
* If the interpolation type is `flat`, then interpolation sampling [=shader-creation error|must not=] be specified.
9579+
* If the interpolation type is `flat`, then:
9580+
* If interpolation sampling is specified, it [=shader-creation error|must=] be `first` or `either`.
9581+
* Otherwise, `first` is assumed.
95749582
* If the interpolation type is `perspective` or `linear`, then:
9575-
* Any interpolation sampling is valid.
9576-
* If interpolation sampling is not specified, `center` is assumed.
9583+
* If interpolation sampling is specified, it [=shader-creation error|must=] be `center`, `centroid`, or `sample`.
9584+
* Otherwise, `center` is assumed.
95779585

95789586
User-defined [=vertex=] outputs and [=fragment=] inputs of scalar or vector
9579-
integer type [=shader-creation error|must=] always be specified as
9580-
`@interpolate(flat)`.
9587+
integer type [=shader-creation error|must=] always be specified with interpolation type `flat`.
95819588

95829589
Interpolation attributes [=shader-creation error|must=] match between [=vertex=] outputs and [=fragment=]
95839590
inputs with the same [=attribute/location=] assignment within the same [=pipeline=].

wgsl/tools/keywords

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ push @deliberately_unreserved, qw(
4949
center
5050
centroid
5151
sample
52+
first
53+
either
5254
5355
vertex_index
5456
instance_index

0 commit comments

Comments
 (0)