C Specification
To query the memory layout of an image subresource, call:
// Provided by VK_VERSION_1_0
void vkGetImageSubresourceLayout(
VkDevice device,
VkImage image,
const VkImageSubresource* pSubresource,
VkSubresourceLayout* pLayout);
Parameters
-
device
is the logical device that owns the image. -
image
is the image whose layout is being queried. -
pSubresource
is a pointer to a VkImageSubresource structure selecting a specific image subresource from the image. -
pLayout
is a pointer to a VkSubresourceLayout structure in which the layout is returned.
Description
If the image is linear, then the returned layout is valid for host access.
If the image’s
tiling is VK_IMAGE_TILING_LINEAR
and its
format is a multi-planar
format, then vkGetImageSubresourceLayout
describes one
format plane
of the image.
If the image’s tiling is VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT
, then
vkGetImageSubresourceLayout
describes one memory plane of the image.
If the image’s tiling is VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT
and
the image is non-linear, then the returned
layout has an implementation-dependent meaning; the vendor of the image’s
DRM format modifier may provide
documentation that explains how to interpret the returned layout.
vkGetImageSubresourceLayout
is invariant for the lifetime of a single
image.
However, the subresource layout of images in Android hardware buffer
external memory is not known until the image has been bound to memory, so
applications must not call vkGetImageSubresourceLayout for such an
image before it has been bound.
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.