From: Tim Hughes Date: Fri, 14 Jul 2017 12:56:54 +0000 (+0100) Subject: Fix missing invalidates for output buffers. X-Git-Tag: upstream/0.1.0~147 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91459cb30edf4ea279715f11e5aad57cfd6d94aa;p=platform%2Fupstream%2FVK-GL-CTS.git Fix missing invalidates for output buffers. Affects: dEQP-VK.spirv_assembly.instruction.compute.* Component: Vulkan VK-GL-CTS issue: 631 Change-Id: I4ca377acfec6a02a3b2ffe333223176ca6c7b9f4 --- diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderCase.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderCase.cpp index 03b8904..54c5889 100644 --- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderCase.cpp +++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderCase.cpp @@ -100,6 +100,11 @@ void fillMemoryWithValue (const DeviceInterface& vkdi, const VkDevice& device, A flushMappedMemoryRange(vkdi, device, destAlloc->getMemory(), destAlloc->getOffset(), numBytes); } +void invalidateMemory (const DeviceInterface& vkdi, const VkDevice& device, Allocation* srcAlloc, size_t numBytes) +{ + invalidateMappedMemoryRange(vkdi, device, srcAlloc->getMemory(), srcAlloc->getOffset(), numBytes); +} + /*--------------------------------------------------------------------*//*! * \brief Create a descriptor set layout with the given descriptor types * @@ -466,6 +471,12 @@ tcu::TestStatus SpvAsmComputeShaderInstance::iterate (void) VK_CHECK(vkdi.queueSubmit(queue, 1, &submitInfo, *cmdCompleteFence)); VK_CHECK(vkdi.waitForFences(device, 1, &cmdCompleteFence.get(), 0u, infiniteTimeout)); // \note: timeout is failure + // Invalidate output memory ranges before checking on host. + for (size_t outputNdx = 0; outputNdx < m_shaderSpec.outputs.size(); ++outputNdx) + { + invalidateMemory(vkdi, device, outputAllocs[outputNdx].get(), m_shaderSpec.outputs[outputNdx]->getNumBytes()); + } + // Check output. if (m_shaderSpec.verifyIO) {