What is depth in VkExtent3D?

Hello,
What is depth in VkExtent3D,
which has width, height, depth as members ?

For example, if depth = 3, what does this mean?

A 3-dimensional rectangle requires 3 numbers to define its size. They represent the 3 sizes that define the extent of that rectangle.

Exactly what those dimensions represents in physical space (directions in some space, etc) depends on where the extent gets used. Even “width” doesn’t have to mean “left-to-right”, depending on the orientation of the viewer relative to the rectangle.

Hello, Alfonse
How are you?

If that VkExtent3D variable is for a VkImage variable (appeared inside VkImageCreateInfo)
and if depth = 3,
I guess, this means there are three 2D images in one VkImage variable
or that VkImage may be considered a 3D image

So is it correct?

Array layers are a separate thing from the image’s extents. That’s what VkImageCreateInfo::arrayLayers is for. The image’s extent specifies the extent of one array layer.

If the depth is not 1, the image must use the VK_IMAGE_TYPE_3D type. There’s an explicit validation layer check for this.

1 Like

Oh, thank you so much
I understand what you mean now
See you again, Alfonse