Skip to content

Commit 189c73a

Browse files
committed
Describe tight-packing of image-copy ops, including depth/stencil
Fixes #652
1 parent efe70a0 commit 189c73a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/index.bs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5983,6 +5983,11 @@ dictionary GPUImageCopyExternalImage {
59835983
WebGPU provides {{GPUCommandEncoder/copyBufferToTexture()}} for buffer-to-texture copies and
59845984
{{GPUCommandEncoder/copyTextureToBuffer()}} for texture-to-buffer copies.
59855985

5986+
Pixels are tightly-packed in the linear-memory layout of each row of an image copy.
5987+
This includes [[#depth-formats|copies to/from specific aspects of depth/stencil textures]]:
5988+
stencil values are tightly packed in an array of bytes;
5989+
depth values are tightly packed in an array of the appropriate type ("depth16unorm" or "depth32float").
5990+
59865991
The following definitions and validation rules apply to both {{GPUCommandEncoder/copyBufferToTexture()}}
59875992
and {{GPUCommandEncoder/copyTextureToBuffer()}}.
59885993

@@ -9960,7 +9965,8 @@ and {{GPUTextureUsage/STORAGE_BINDING|GPUTextureUsage.STORAGE_BINDING}} usage re
99609965

99619966
### Depth/stencil formats ### {#depth-formats}
99629967

9963-
All depth formats support {{GPUTextureUsage/COPY_SRC}}, {{GPUTextureUsage/COPY_DST}}, {{GPUTextureUsage/TEXTURE_BINDING}}, and {{GPUTextureUsage/RENDER_ATTACHMENT}} usage. However, the source/destination is restricted based on the format.
9968+
All depth formats support {{GPUTextureUsage/COPY_SRC}}, {{GPUTextureUsage/COPY_DST}}, {{GPUTextureUsage/TEXTURE_BINDING}}, and {{GPUTextureUsage/RENDER_ATTACHMENT}} usage.
9969+
However, the source/destination of copy operations is restricted based on the format.
99649970

99659971
None of the depth formats can be filtered.
99669972

0 commit comments

Comments
 (0)