Function Prototype

vkGetRenderAreaGranularity

Returns the granularity for optimal render area

To query the render area granularity, call:

void vkGetRenderAreaGranularity(
    VkDevice device,
    VkRenderPass renderPass,
    VkExtent2D* pGranularity);
  • device is the logical device that owns the render pass.
  • renderPass is a handle to a render pass.
  • pGranularity is a pointer to a VkExtent2D structure in which the granularity is returned.

The conditions leading to an optimal renderArea are:

  • the offset.x member in renderArea is a multiple of the width member of the returned VkExtent2D (the horizontal granularity).
  • the offset.y member in renderArea is a multiple of the height member of the returned VkExtent2D (the vertical granularity).
  • either the extent.width member in renderArea is a multiple of the horizontal granularity or offset.x+extent.width is equal to the width of the framebuffer in the VkRenderPassBeginInfo.
  • either the extent.height member in renderArea is a multiple of the vertical granularity or offset.y+extent.height is equal to the height of the framebuffer in the VkRenderPassBeginInfo.

Subpass dependencies are not affected by the render area, and apply to the entire image subresources attached to the framebuffer as specified in the description of automatic layout transitions. Similarly, pipeline barriers are valid even if their effect extends outside the render area.

Valid Usage (Implicit)

VUID-vkGetRenderAreaGranularity-pGranularity-parameter

pGranularity must be a valid pointer to a VkExtent2D structure

VUID-vkGetRenderAreaGranularity-renderPass-parent

renderPass must have been created, allocated, or retrieved from device