C Specification

To query the memory layout of an image subresource, call:

// Provided by VK_VERSION_1_4
void vkGetImageSubresourceLayout2(
    VkDevice                                    device,
    VkImage                                     image,
    const VkImageSubresource2*                  pSubresource,
    VkSubresourceLayout2*                       pLayout);
// Provided by VK_KHR_maintenance5
// Equivalent to vkGetImageSubresourceLayout2
void vkGetImageSubresourceLayout2KHR(
    VkDevice                                    device,
    VkImage                                     image,
    const VkImageSubresource2*                  pSubresource,
    VkSubresourceLayout2*                       pLayout);
// Provided by VK_EXT_host_image_copy, VK_EXT_image_compression_control
// Equivalent to vkGetImageSubresourceLayout2
void vkGetImageSubresourceLayout2EXT(
    VkDevice                                    device,
    VkImage                                     image,
    const VkImageSubresource2*                  pSubresource,
    VkSubresourceLayout2*                       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 VkImageSubresource2 structure selecting a specific image for the image subresource.

  • pLayout is a pointer to a VkSubresourceLayout2 structure in which the layout is returned.

Description

vkGetImageSubresourceLayout2 behaves similarly to vkGetImageSubresourceLayout, with the ability to specify extended inputs via chained input structures, and to return extended information via chained output structures.

It is legal to call vkGetImageSubresourceLayout2 with an image created with tiling equal to VK_IMAGE_TILING_OPTIMAL, but the members of VkSubresourceLayout2::subresourceLayout will have undefined values in this case.

Note

Structures chained from VkImageSubresource2::pNext will also be updated when tiling is equal to VK_IMAGE_TILING_OPTIMAL.

Valid Usage
Valid Usage (Implicit)
  • VUID-vkGetImageSubresourceLayout2-device-parameter
    device must be a valid VkDevice handle

  • VUID-vkGetImageSubresourceLayout2-image-parameter
    image must be a valid VkImage handle

  • VUID-vkGetImageSubresourceLayout2-pSubresource-parameter
    pSubresource must be a valid pointer to a valid VkImageSubresource2 structure

  • VUID-vkGetImageSubresourceLayout2-pLayout-parameter
    pLayout must be a valid pointer to a VkSubresourceLayout2 structure

  • VUID-vkGetImageSubresourceLayout2-image-parent
    image must have been created, allocated, or retrieved from device

See Also

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.

Copyright 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0