Fix maxMipMap calculation for images
authorMikel Garai <mikel.garai@arm.com>
Wed, 3 Jun 2020 12:28:34 +0000 (14:28 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 11 Jun 2020 15:08:05 +0000 (11:08 -0400)
This change uses the floor of the log2 instead of the ceiling as
described in vulkan specification for normal images.

Vulkan spec section: 11.3.3. Image Miplevel Sizing

Components: Vulkan

Affects:
dEQP-VK.api.info.image_format_properties.*

VK-GL-CTS Issue: 2407

Change-Id: Ic5c7afe5890ebf1b5cc00abd1534a4a4d0c9c3c9

external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp

index bb46e7a..d9564c0 100644 (file)
@@ -3944,9 +3944,9 @@ tcu::TestStatus imageFormatProperties (Context& context, const VkFormat format,
 
                        if (queryResult == VK_SUCCESS)
                        {
-                               const deUint32  fullMipPyramidSize      = de::max(de::max(deLog2Ceil32(properties.maxExtent.width),
-                                                                                                                                         deLog2Ceil32(properties.maxExtent.height)),
-                                                                                                                         deLog2Ceil32(properties.maxExtent.depth)) + 1;
+                               const deUint32  fullMipPyramidSize      = de::max(de::max(deLog2Floor32(properties.maxExtent.width),
+                                                                                                                                         deLog2Floor32(properties.maxExtent.height)),
+                                                                                                                         deLog2Floor32(properties.maxExtent.depth)) + 1;
 
                                log << TestLog::Message << properties << "\n" << TestLog::EndMessage;