@@ -110,7 +110,7 @@ dictionary GPUImageCopyBuffer
110
110
copied, depending on the method it is being passed to.
111
111
</dl>
112
112
113
- <div algorithm class=validusage >
113
+ <div algorithm data-timeline=device >
114
114
<dfn abstract-op>validating GPUImageCopyBuffer</dfn>
115
115
116
116
**Arguments:**
@@ -119,9 +119,14 @@ dictionary GPUImageCopyBuffer
119
119
120
120
**Returns:** {{boolean}}
121
121
122
+ [=Device timeline=] steps:
123
+
122
124
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>
125
130
</div>
126
131
127
132
<h4 id=gpuimagecopytexture data-dfn-type=dictionary>`GPUImageCopyTexture`
@@ -160,8 +165,8 @@ dictionary GPUImageCopyTexture {
160
165
Defines which aspects of the {{GPUImageCopyTexture/texture}} to copy to/from.
161
166
</dl>
162
167
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|)
165
170
166
171
**Arguments:**
167
172
@@ -170,19 +175,73 @@ dictionary GPUImageCopyTexture {
170
175
171
176
**Returns:** {{boolean}}
172
177
178
+ [=Device timeline=] steps:
179
+
173
180
1. Let |blockWidth| be the [=texel block width=] of |imageCopyTexture|.{{GPUImageCopyTexture/texture}} .{{GPUTexture/format}} .
174
181
1. Let |blockHeight| be the [=texel block height=] of |imageCopyTexture|.{{GPUImageCopyTexture/texture}} .{{GPUTexture/format}} .
175
182
176
183
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 <
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}} > 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 <
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}} > 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>
186
245
</div>
187
246
188
247
Issue(gpuweb/gpuweb#69): Define the copies with {{GPUTextureDimension/1d}} and {{GPUTextureDimension/3d}} textures.
@@ -263,7 +322,7 @@ dictionary GPUImageCopyExternalImage {
263
322
The source of the [=image copy=] . The copy source data is captured at the moment that
264
323
{{GPUQueue/copyExternalImageToTexture()}} is issued. Source size is defined by source
265
324
type, given by this table:
266
-
325
+
267
326
<table class=data>
268
327
<thead>
269
328
<tr>
@@ -302,7 +361,7 @@ dictionary GPUImageCopyExternalImage {
302
361
<tr>
303
362
<td> {{HTMLCanvasElement}} or {{OffscreenCanvas}} with {{ImageBitmapRenderingContext}}
304
363
<td> {{ImageBitmapRenderingContext}} 's internal output bitmap
305
- {{ImageBitmap/width|ImageBitmap.width}} ,
364
+ {{ImageBitmap/width|ImageBitmap.width}} ,
306
365
{{ImageBitmap/height|ImageBitmap.height}}
307
366
</tbody>
308
367
</table>
@@ -324,7 +383,7 @@ dictionary GPUImageCopyExternalImage {
324
383
325
384
### Subroutines ### {#image-copies-subroutines}
326
385
327
- <div algorithm="imageCopyTexture physical subresource size">
386
+ <div algorithm="imageCopyTexture physical subresource size" data-timeline=const >
328
387
<dfn dfn>imageCopyTexture physical subresource size</dfn>
329
388
330
389
**Arguments:**
@@ -340,7 +399,7 @@ dictionary GPUImageCopyExternalImage {
340
399
|imageCopyTexture|.{{GPUImageCopyTexture/mipLevel}} .
341
400
</div>
342
401
343
- <div algorithm>
402
+ <div algorithm data-timeline=device >
344
403
<dfn abstract-op>validating linear texture data</dfn> (layout, byteSize, format, copyExtent)
345
404
346
405
**Arguments:**
@@ -354,6 +413,8 @@ dictionary GPUImageCopyExternalImage {
354
413
: {{GPUExtent3D}} |copyExtent|
355
414
:: Extent of the texture to copy.
356
415
416
+ [=Device timeline=] steps:
417
+
357
418
1. Let:
358
419
- |widthInBlocks| be |copyExtent|.[=GPUExtent3D/width=] ÷ the [=texel block width=] of |format|.
359
420
[=Assert=] this is an integer.
@@ -393,8 +454,8 @@ dictionary GPUImageCopyExternalImage {
393
454
</div>
394
455
</div>
395
456
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>
398
459
399
460
**Arguments:**
400
461
@@ -403,31 +464,35 @@ dictionary GPUImageCopyExternalImage {
403
464
: {{GPUExtent3D}} |copySize|
404
465
:: The size of the texture.
405
466
467
+ [=Device timeline=] steps:
468
+
406
469
1. Let |blockWidth| be the [=texel block width=] of |imageCopyTexture|.{{GPUImageCopyTexture/texture}} .{{GPUTexture/format}} .
407
470
1. Let |blockHeight| be the [=texel block height=] of |imageCopyTexture|.{{GPUImageCopyTexture/texture}} .{{GPUTexture/format}} .
408
471
1. Let |subresourceSize| be the [=imageCopyTexture physical subresource size=] of |imageCopyTexture|.
409
472
1. Return whether all the conditions below are satisfied:
410
473
411
- - (|imageCopyTexture|.{{GPUImageCopyTexture/origin}} .[=GPUOrigin3D/x=] + |copySize|.[=GPUExtent3D/width=] ) ≤ |subresourceSize|.[=GPUExtent3D/width=]
412
- - (|imageCopyTexture|.{{GPUImageCopyTexture/origin}} .[=GPUOrigin3D/y=] + |copySize|.[=GPUExtent3D/height=] ) ≤ |subresourceSize|.[=GPUExtent3D/height=]
413
- - (|imageCopyTexture|.{{GPUImageCopyTexture/origin}} .[=GPUOrigin3D/z=] + |copySize|.[=GPUExtent3D/depthOrArrayLayers=] ) ≤ |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=] ) ≤ |subresourceSize|.[=GPUExtent3D/width=]
476
+ - (|imageCopyTexture|.{{GPUImageCopyTexture/origin}} .[=GPUOrigin3D/y=] + |copySize|.[=GPUExtent3D/height=] ) ≤ |subresourceSize|.[=GPUExtent3D/height=]
477
+ - (|imageCopyTexture|.{{GPUImageCopyTexture/origin}} .[=GPUOrigin3D/z=] + |copySize|.[=GPUExtent3D/depthOrArrayLayers=] ) ≤ |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>
421
486
</div>
422
487
423
- <div algorithm>
488
+ <div algorithm data-timeline=const >
424
489
Two {{GPUTextureFormat}} s |format1| and |format2| are <dfn dfn>copy-compatible</dfn> if:
425
490
426
491
- |format1| equals |format2|, or
427
492
- |format1| and |format2| differ only in whether they are `srgb` formats (have the `-srgb` suffix).
428
493
</div>
429
494
430
- <div algorithm>
495
+ <div algorithm data-timeline=const >
431
496
The <dfn abstract-op>set of subresources for texture copy</dfn> (|imageCopyTexture|, |copySize|)
432
497
is the subset of subresources of |texture| = |imageCopyTexture|.{{GPUImageCopyTexture/texture}}
433
498
for which each subresource |s| satisfies the following:
0 commit comments