Skip to content

Commit b25a71e

Browse files
Quick update to Image copies
Very small addition on the joys of VK_FORMAT_G8B8G8R8_422_UNORM
1 parent 47a2259 commit b25a71e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

chapters/image_copies.adoc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,16 @@ VkBufferImageCopy region[2];
232232
region[0].imageSubresource.aspectMask = VK_IMAGE_ASPECT_PLANE_0_BIT;
233233
region[0].imageExtent = {width, height, 1};
234234
235-
region[0].imageSubresource.aspectMask = VK_IMAGE_ASPECT_PLANE_1_BIT;
236-
region[0].imageExtent = {width / 2, height / 2, 1};
235+
region[1].imageSubresource.aspectMask = VK_IMAGE_ASPECT_PLANE_1_BIT;
236+
region[1].imageExtent = {width / 2, height / 2, 1};
237237
----
238238

239-
image::{images}image_copies_multi_planar.svg[image_copies_multi_planar.svg]
239+
image::{images}image_copies_multi_planar.svg[image_copies_multi_planar.svg]
240+
241+
=== Singlar-Planar YCbCr
242+
243+
There is anthoer edge case to watch out for! Formats such as `VK_FORMAT_G8B8G8R8_422_UNORM` can be tricky as they not are technically compressed, but also not multi-planar (so you copy with `VK_IMAGE_ASPECT_COLOR_BIT`).
244+
245+
The spec does give you a hint how to and handle them for copies:
246+
247+
"[VK_FORMAT_G8B8G8R8_422_UNORM] For the purposes of the constraints on copy extents, this format is treated as a compressed format with a 2×1 compressed texel block."

0 commit comments

Comments
 (0)