Memory binding tests not invaidating host memory before results check.
authorStephen Gallimore <stephen.gallimore@broadcom.com>
Tue, 12 Jun 2018 14:35:46 +0000 (15:35 +0100)
committerStephen Gallimore <stephen.gallimore@broadcom.com>
Wed, 13 Jun 2018 12:33:27 +0000 (13:33 +0100)
Affected tests:
dEQP-VK.memory.binding.*.buffer_*

Components: Vulkan

VK-GL-CTS issue: 1214

Change-Id: Ib347401ee818a42487df001f3ba76247b157321c

external/vulkancts/modules/vulkan/memory/vktMemoryBindingTests.cpp

index 6e47e24..3764625 100644 (file)
@@ -93,6 +93,14 @@ public:
                VK_CHECK(vk.flushMappedMemoryRanges(dev, 1u, &range));
        }
 
+       void                                                            invalidate                                                      (VkDeviceSize                   offset,
+                                                                                                                                                        VkDeviceSize                   size)
+       {
+               const VkMappedMemoryRange               range                                                           = makeMemoryRange(offset, size);
+               VK_CHECK(vk.invalidateMappedMemoryRanges(dev, 1u, &range));
+       }
+
+
 protected:
        const DeviceInterface&                          vk;
        const VkDevice&                                         dev;
@@ -818,6 +826,8 @@ deBool                                                                      checkData                                                       (VkDeviceMemory                 memory,
        deUint8*                                                        hostBuffer                                                      = static_cast<deUint8*>(hostMemory.ptr());
        SimpleRandomGenerator                           random                                                          (dataSeed);
 
+       hostMemory.invalidate(0u, params.bufferSize);
+
        for (deUint32 i = 0u; i < params.bufferSize; ++i)
        {
                if (hostBuffer[i] != static_cast<deUint8>(random.getNext() & 0xFFu) )