Fix barrier and invalidation of the fill_buffer readback
authorDzmitry Malyshau <dmalyshau@mozilla.com>
Mon, 7 May 2018 20:24:07 +0000 (16:24 -0400)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 22 May 2018 09:32:49 +0000 (05:32 -0400)
The old code had a barrier waiting for a different memory region that is being
filled, and same goes for the memory invalidation call that follows.
It resulted in the range of size=0 being requeste for invalidation, which
doesn't include actual bytes filled by cmdFillBuffer that is being tested.

Affects:
dEQP-VK.api.fill_and_update_buffer.*

Change-Id: Id2d68dc65145b42ecb0f966c70d57db81e9acb4a
Components: Vulkan

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

index bcaae49..6fd48ee 100644 (file)
@@ -146,8 +146,8 @@ tcu::TestStatus                                             FillBufferTestInstance::iterate         (void)
                VK_QUEUE_FAMILY_IGNORED,                                                                                // deUint32                                     srcQueueFamilyIndex;
                VK_QUEUE_FAMILY_IGNORED,                                                                                // deUint32                                     dstQueueFamilyIndex;
                *m_destination,                                                                                                 // VkBuffer                                     buffer;
-               0u,                                                                                                                             // VkDeviceSize                         offset;
-               m_params.dstOffset                                                                                              // VkDeviceSize                         size;
+               m_params.dstOffset,                                                                                             // VkDeviceSize                         offset;
+               m_params.dstSize                                                                                                // VkDeviceSize                         size;
        };
 
        beginCommandBuffer(vk, *m_cmdBuffer);
@@ -159,7 +159,7 @@ tcu::TestStatus                                             FillBufferTestInstance::iterate         (void)
 
        // Read buffer data
        de::MovePtr<tcu::TextureLevel>  resultLevel     (new tcu::TextureLevel(m_destinationTextureLevel->getAccess().getFormat(), dstLevelWidth, 1));
-       invalidateMappedMemoryRange(vk, vkDevice, m_destinationBufferAlloc->getMemory(), m_destinationBufferAlloc->getOffset(), m_params.dstOffset);
+       invalidateMappedMemoryRange(vk, vkDevice, m_destinationBufferAlloc->getMemory(), m_destinationBufferAlloc->getOffset() + m_params.dstOffset, m_params.dstSize);
        tcu::copy(*resultLevel, tcu::ConstPixelBufferAccess(resultLevel->getFormat(), resultLevel->getSize(), m_destinationBufferAlloc->getHostPtr()));
 
        return checkTestResult(resultLevel->getAccess());