VK_KHR_maintenance2: View block-compressed speedup
authorBoris Zanin <boris.zanin@mobica.com>
Thu, 24 Aug 2017 08:29:06 +0000 (10:29 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 31 Aug 2017 18:19:15 +0000 (14:19 -0400)
Do strict comparison first, if it fails use fuzzy.

Update tests:
* dEQP-VK.image.texel_view_compatible.compute.*

Components: Vulkan

VK-GL-CTS issue: 124

Change-Id: I1ad580d60638ba3fce83fc913819608d5d9a8812
(cherry picked from commit c9e2dea449429762592af0530b609cf80ab913ce)

external/vulkancts/modules/vulkan/image/vktImageCompressionTranscodingSupport.cpp

index c0a2793..d33b206 100644 (file)
@@ -1140,20 +1140,16 @@ bool BasicComputeTestInstance::decompressImage (const VkCommandBuffer&  cmdBuffer
                invalidateMappedMemoryRange(vk, device, resultAlloc.getMemory(), resultAlloc.getOffset(), bufferSize);
                invalidateMappedMemoryRange(vk, device, referenceAlloc.getMemory(), referenceAlloc.getOffset(), bufferSize);
 
-               ConstPixelBufferAccess  resultPixels            (mapVkFormat(decompressedImageInfo.format), decompressedImageInfo.extent.width, decompressedImageInfo.extent.height, decompressedImageInfo.extent.depth, resultAlloc.getHostPtr());
-               ConstPixelBufferAccess  referencePixels         (mapVkFormat(decompressedImageInfo.format), decompressedImageInfo.extent.width, decompressedImageInfo.extent.height, decompressedImageInfo.extent.depth, referenceAlloc.getHostPtr());
-
-               if (decompressedImageInfo.extent.width > 2)
+               if (deMemCmp(resultAlloc.getHostPtr(), referenceAlloc.getHostPtr(), (size_t)bufferSize) != 0)
                {
+                       ConstPixelBufferAccess  resultPixels            (mapVkFormat(decompressedImageInfo.format), decompressedImageInfo.extent.width, decompressedImageInfo.extent.height, decompressedImageInfo.extent.depth, resultAlloc.getHostPtr());
+                       ConstPixelBufferAccess  referencePixels         (mapVkFormat(decompressedImageInfo.format), decompressedImageInfo.extent.width, decompressedImageInfo.extent.height, decompressedImageInfo.extent.depth, referenceAlloc.getHostPtr());
+
                        if(!fuzzyCompare(m_context.getTestContext().getLog(), "Image Comparison", "Image Comparison", resultPixels, referencePixels, 0.001f, tcu::COMPARE_LOG_EVERYTHING))
                                return false;
                }
-               else
-               {
-                       if (deMemCmp(resultAlloc.getHostPtr(), referenceAlloc.getHostPtr(), (size_t)bufferSize))
-                               return false;
-               }
        }
+
        return true;
 }