Fix AHB external memory test mip levels
authorAri Suonpaa <ari.suonpaa@siru.fi>
Tue, 14 Sep 2021 10:08:37 +0000 (13:08 +0300)
committerAri Suonpaa <ari.suonpaa@siru.fi>
Tue, 14 Sep 2021 10:08:37 +0000 (13:08 +0300)
AHB external memory tests were testing mipmaps using a
queried maximum number of supported mipmap levels, but
at the same time using an image size of 64x64.
The number of mip levels need to match the number for a
full mip chain, in this case 7. Now a correct number of
mip levels is used, which also gets rid of a validation
error.

VK-GL-CTS Issue: 3112

Affects:

dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.*

Components: Vulkan
Change-Id: I1c6d09f93c06ac1c52cea283fd86359ccde01e4f

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

index f30ca2f..2ec1717 100644 (file)
@@ -4169,9 +4169,9 @@ tcu::TestStatus testAndroidHardwareBufferImageFormat  (Context& context, vk::VkF
                                context.getTestContext().touchWatchdog();
                        }
 
-                       if (properties.imageFormatProperties.maxMipLevels > 1u)
+                       if (properties.imageFormatProperties.maxMipLevels >= 7u)
                        {
-                               const vk::Unique<vk::VkImage>                   image                                   (createExternalImage(vkd, *device, queueFamilyIndex, externalMemoryType, format, 64u, 64u, tiling, createFlag, usage, properties.imageFormatProperties.maxMipLevels));
+                               const vk::Unique<vk::VkImage>                   image                                   (createExternalImage(vkd, *device, queueFamilyIndex, externalMemoryType, format, 64u, 64u, tiling, createFlag, usage, 7u));
                                const vk::VkMemoryRequirements                  requirements                    (getImageMemoryRequirements(vkd, *device, *image, externalMemoryType));
                                const deUint32                                                  exportedMemoryTypeIndex (chooseMemoryType(requirements.memoryTypeBits));
                                const vk::Unique<vk::VkDeviceMemory>    memory                                  (allocateExportableMemory(vkd, *device, requirements.size, exportedMemoryTypeIndex, externalMemoryType, *image));