Skip to content

Commit

Permalink
Clarify the check on buffer offset in buffer-texture copy with depth …
Browse files Browse the repository at this point in the history
…stencil formats (gpuweb#1528)

* Clarify the check on buffer offset in buffer-texture copy with depth stencil formats

This patch intends to clarify the validation rules on the
buffer offset in copyBufferToTexture() and copyTextureToBuffer() with
depth stencil formats. (The buffer offset must be a multiple of 4 when
the texture has a depth/stencil format).

According to Vulkan SPEC (1.2.172, chapter 19.4):
- VUID-vkCmdCopyBufferToImage-srcImage-04053
  If dstImage has a depth/stencil format, the bufferOffset member of any
  element of pRegions must be a multiple of 4
- VUID-vkCmdCopyImageToBuffer-srcImage-04053
  If srcImage has a depth/stencil format, the bufferOffset member of any
  element of pRegions must be a multiple of 4

* Small fix
  • Loading branch information
Jiawei-Shao authored Mar 25, 2021
1 parent db636a9 commit 0c7cece
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -5254,8 +5254,11 @@ Issue: convert "Valid Texture Copy Range" into an algorithm with parameters, sim
|destination|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}}.
See [[#depth-formats|depth-formats]].
- [=Valid Texture Copy Range=] applies to |destination| and |copySize|.
- |source|.{{GPUImageDataLayout/offset}} is a multiple of the [=texel block size=]
of |destination|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}}.
- If |destination|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}} is not a depth/stencil format:
- |source|.{{GPUImageDataLayout/offset}} is a multiple of the [=texel block size=] of
|destination|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}}.
- If |destination|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}} is a depth/stencil format:
- |source|.{{GPUImageDataLayout/offset}} is a multiple of 4.
- [$validating linear texture data$](|source|,
|source|.{{GPUImageCopyBuffer/buffer}}.{{GPUBuffer/[[size]]}},
|destination|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}},
Expand Down Expand Up @@ -5295,8 +5298,11 @@ Issue: convert "Valid Texture Copy Range" into an algorithm with parameters, sim
- |destination|.{{GPUImageCopyBuffer/buffer}}.{{GPUBuffer/[[usage]]}} contains
{{GPUBufferUsage/COPY_DST}}.
- [=Valid Texture Copy Range=] applies to |source| and |copySize|.
- |destination|.{{GPUImageDataLayout/offset}} is a multiple of the [=texel block size=]
of |destination|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}}.
- If |source|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}} is not a depth/stencil format:
- |destination|.{{GPUImageDataLayout/offset}} is a multiple of the [=texel block size=] of
|source|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}}.
- If |source|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}} is a depth/stencil format:
- |destination|.{{GPUImageDataLayout/offset}} is a multiple of 4.
- [$validating linear texture data$](|destination|,
|destination|.{{GPUImageCopyBuffer/buffer}}.{{GPUBuffer/[[size]]}},
|source|.{{GPUImageCopyTexture/texture}}.{{GPUTexture/[[format]]}},
Expand Down

0 comments on commit 0c7cece

Please sign in to comment.