From ff08db97554ee232b93004fbf63d387bec6b5e81 Mon Sep 17 00:00:00 2001 From: Alexander Galazin Date: Tue, 3 Oct 2017 21:29:50 +0200 Subject: [PATCH] Invalidate memory in draw tests The test group writes to non-coherent device memory with device, but fails to call the required invalidate on the region before reading mapped memory with host. Components: Vulkan VK-GL-CTS issue: 529 Affects: dEQP-VK.draw.* Change-Id: Icf4aa6ea80c8c046e41b37402457b7f094d7ae50 (cherry picked from commit 1ce6e233a6245a1cf81a2a4e88b87c5d381a119a) --- .../modules/vulkan/draw/vktDrawImageObjectUtil.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp b/external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp index e016d2c79..4cc36356f 100644 --- a/external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp +++ b/external/vulkancts/modules/vulkan/draw/vktDrawImageObjectUtil.cpp @@ -367,6 +367,10 @@ void Image::readUsingBuffer (vk::VkQueue queue, VK_CHECK(m_vk.queueWaitIdle(queue)); } + // Validate the results + const vk::Allocation& bufAllocation = stagingResource->getBoundMemory(); + invalidateMappedMemoryRange(m_vk, m_device, bufAllocation.getMemory(), bufAllocation.getOffset(), VK_WHOLE_SIZE); + deUint8* destPtr = reinterpret_cast(stagingResource->getBoundMemory().getHostPtr()); deMemcpy(data, destPtr, static_cast(bufferSize)); } @@ -466,6 +470,10 @@ de::SharedPtr Image::copyToLinearImage (vk::VkQueue queue, // TODO: make this less intrusive VK_CHECK(m_vk.queueWaitIdle(queue)); + + // Validate the results + const vk::Allocation& imgAllocation = stagingResource->getBoundMemory(); + invalidateMappedMemoryRange(m_vk, m_device, imgAllocation.getMemory(), imgAllocation.getOffset(), VK_WHOLE_SIZE); } return stagingResource; } -- 2.34.1