Fix modifier tests - Add Invalidate memory before host read.
authorMatthew Netsch <quic_mnetsch@quicinc.com>
Mon, 6 Jun 2022 15:54:27 +0000 (08:54 -0700)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Mon, 6 Jun 2022 15:54:27 +0000 (08:54 -0700)
Test cases for extension VK_EXT_image_drm_format_modifier were failing randomly due to image mismatch.
This was due to after performing copyImagetoBuffer buffers are not invalidated before reading from host.
Added the invalidate operation for buffer before reading.

Components: Vulkan
VK-GL-CTS Issue: 3744

Affects:
dEQP-VK.drm_format_modifiers.*

Change-Id: I57b27bf9c0beea0ed822b36ea379b024f9d1690a

external/vulkancts/modules/vulkan/modifiers/vktModifiersTests.cpp

index 546bb10..37332cb 100644 (file)
@@ -699,6 +699,8 @@ bool exportImportMemoryExplicitModifiersCase (Context& context, const VkFormat f
        tcu::ConstPixelBufferAccess     result  (referenceTextureFormat, imageSize.x(), imageSize.y(), 1, outputBuffer->getAllocation().getHostPtr());
        const tcu::UVec4 threshold (0u);
 
+       invalidateAlloc(vkd, device, outputBuffer->getAllocation());
+
        return tcu::intThresholdCompare(context.getTestContext().getLog(), "Compare", "Result comparison", referenceImage, result, threshold, tcu::COMPARE_LOG_RESULT);
 }