const vk::VkBool32 clipped = VK_FALSE;
vector<vk::VkSwapchainCreateInfoKHR> createInfos;
+ const deUint32 currentWidth = properties.currentExtent.width != 0xFFFFFFFFu
+ ? properties.currentExtent.width
+ : de::min(1024u, properties.minImageExtent.width + ((properties.maxImageExtent.width - properties.minImageExtent.width) / 2));
+ const deUint32 currentHeight = properties.currentExtent.height != 0xFFFFFFFFu
+ ? properties.currentExtent.height
+ : de::min(1024u, properties.minImageExtent.height + ((properties.maxImageExtent.height - properties.minImageExtent.height) / 2));
+
const deUint32 imageWidth = scaling == SCALING_NONE
- ? (properties.currentExtent.width != 0xFFFFFFFFu
- ? properties.currentExtent.width
- : de::min(1024u, properties.minImageExtent.width + ((properties.maxImageExtent.width - properties.minImageExtent.width) / 2)))
+ ? currentWidth
: (scaling == SCALING_UP
? de::max(31u, properties.minImageExtent.width)
- : properties.maxImageExtent.width);
+ : de::min(deSmallestGreaterOrEquallPowerOfTwoU32(currentWidth+1), properties.maxImageExtent.width));
const deUint32 imageHeight = scaling == SCALING_NONE
- ? (properties.currentExtent.height != 0xFFFFFFFFu
- ? properties.currentExtent.height
- : de::min(1024u, properties.minImageExtent.height + ((properties.maxImageExtent.height - properties.minImageExtent.height) / 2)))
+ ? currentHeight
: (scaling == SCALING_UP
? de::max(31u, properties.minImageExtent.height)
- : properties.maxImageExtent.height);
+ : de::min(deSmallestGreaterOrEquallPowerOfTwoU32(currentHeight+1), properties.maxImageExtent.height));
const vk::VkExtent2D imageSize = { imageWidth, imageHeight };
{