1// Copyright 2014-2022 The Khronos Group Inc. 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[open,refpage='VkPresentRegionsKHR',desc='Structure hint of rectangular regions changed by vkQueuePresentKHR',type='structs'] 6-- 7When the `apiext:VK_KHR_incremental_present` extension is enabled, 8additional fields can: be specified that allow an application to specify 9that only certain rectangular regions of the presentable images of a 10swapchain are changed. 11This is an optimization hint that a presentation engine may: use to only 12update the region of a surface that is actually changing. 13The application still must: ensure that all pixels of a presented image 14contain the desired values, in case the presentation engine ignores this 15hint. 16An application can: provide this hint by adding a sname:VkPresentRegionsKHR 17structure to the pname:pNext chain of the sname:VkPresentInfoKHR structure. 18 19The sname:VkPresentRegionsKHR structure is defined as: 20 21include::{generated}/api/structs/VkPresentRegionsKHR.adoc[] 22 23 * pname:sType is the type of this structure. 24 * pname:pNext is `NULL` or a pointer to a structure extending this 25 structure. 26 * pname:swapchainCount is the number of swapchains being presented to by 27 this command. 28 * pname:pRegions is `NULL` or a pointer to an array of 29 sname:VkPresentRegionKHR elements with pname:swapchainCount entries. 30 If not `NULL`, each element of pname:pRegions contains the region that 31 has changed since the last present to the swapchain in the corresponding 32 entry in the sname:VkPresentInfoKHR::pname:pSwapchains array. 33 34.Valid Usage 35**** 36 * [[VUID-VkPresentRegionsKHR-swapchainCount-01260]] 37 pname:swapchainCount must: be the same value as 38 sname:VkPresentInfoKHR::pname:swapchainCount, where 39 sname:VkPresentInfoKHR is included in the pname:pNext chain of this 40 sname:VkPresentRegionsKHR structure 41**** 42 43include::{generated}/validity/structs/VkPresentRegionsKHR.adoc[] 44-- 45 46[open,refpage='VkPresentRegionKHR',desc='Structure containing rectangular region changed by vkQueuePresentKHR for a given VkImage',type='structs'] 47-- 48For a given image and swapchain, the region to present is specified by the 49sname:VkPresentRegionKHR structure, which is defined as: 50 51include::{generated}/api/structs/VkPresentRegionKHR.adoc[] 52 53 * pname:rectangleCount is the number of rectangles in pname:pRectangles, 54 or zero if the entire image has changed and should be presented. 55 * pname:pRectangles is either `NULL` or a pointer to an array of 56 sname:VkRectLayerKHR structures. 57 The sname:VkRectLayerKHR structure is the framebuffer coordinates, plus 58 layer, of a portion of a presentable image that has changed and must: be 59 presented. 60 If non-`NULL`, each entry in pname:pRectangles is a rectangle of the 61 given image that has changed since the last image was presented to the 62 given swapchain. 63 The rectangles must: be specified relative to 64 slink:VkSurfaceCapabilitiesKHR::pname:currentTransform, regardless of 65 the swapchain's pname:preTransform. 66 The presentation engine will apply the pname:preTransform transformation 67 to the rectangles, along with any further transformation it applies to 68 the image content. 69 70include::{generated}/validity/structs/VkPresentRegionKHR.adoc[] 71-- 72 73[open,refpage='VkRectLayerKHR',desc='Structure containing a rectangle, including layer, changed by vkQueuePresentKHR for a given VkImage',type='structs'] 74-- 75The sname:VkRectLayerKHR structure is defined as: 76 77include::{generated}/api/structs/VkRectLayerKHR.adoc[] 78 79 * pname:offset is the origin of the rectangle, in pixels. 80 * pname:extent is the size of the rectangle, in pixels. 81 * pname:layer is the layer of the image. 82 For images with only one layer, the value of pname:layer must: be 0. 83 84Some platforms allow the size of a surface to change, and then scale the 85pixels of the image to fit the surface. 86sname:VkRectLayerKHR specifies pixels of the swapchain's image(s), which 87will be constant for the life of the swapchain. 88 89.Valid Usage 90**** 91 * [[VUID-VkRectLayerKHR-offset-04864]] 92 The sum of pname:offset and pname:extent, after being transformed 93 according to the pname:preTransform member of the 94 slink:VkSwapchainCreateInfoKHR structure, must: be no greater than the 95 pname:imageExtent member of the slink:VkSwapchainCreateInfoKHR structure 96 passed to flink:vkCreateSwapchainKHR 97 * [[VUID-VkRectLayerKHR-layer-01262]] 98 pname:layer must: be less than the pname:imageArrayLayers member of the 99 slink:VkSwapchainCreateInfoKHR structure passed to 100 flink:vkCreateSwapchainKHR 101**** 102 103include::{generated}/validity/structs/VkRectLayerKHR.adoc[] 104-- 105