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