From: Jeannot Breton Date: Fri, 22 Jan 2016 18:22:11 +0000 (-0600) Subject: Fix the BindSparseMemory path to wait for a fence before destroying the buffer X-Git-Tag: upstream/0.1.0~812^2~108^2~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4872908d089917cad8601707b4efd6c6ab2e98d;p=platform%2Fupstream%2FVK-GL-CTS.git Fix the BindSparseMemory path to wait for a fence before destroying the buffer --- diff --git a/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp index 55a2745..5cbae44 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiBufferTests.cpp @@ -200,8 +200,20 @@ private: DE_NULL, // const VkSemaphore* pSignalSemaphores; }; - if (vk.queueBindSparse(queue, 1, &bindSparseInfo, DE_NULL) != VK_SUCCESS) + const VkFenceCreateInfo fenceParams = + { + VK_STRUCTURE_TYPE_FENCE_CREATE_INFO, // VkStructureType sType; + DE_NULL, // const void* pNext; + 0u // VkFenceCreateFlags flags; + }; + + const vk::Unique fence = vk::createFence(vk, vkDevice, &fenceParams); + + VK_CHECK(vk.resetFences(vkDevice, 1, &fence.get())); + if (vk.queueBindSparse(queue, 1, &bindSparseInfo, *fence) != VK_SUCCESS) return tcu::TestStatus::fail("Bind sparse buffer memory failed! (requested memory size: " + de::toString(size) + ")"); + + VK_CHECK(vk.waitForFences(vkDevice, 1, &fence.get(), VK_TRUE, ~(0ull) /* infinity */)); } else if (vk.bindBufferMemory(vkDevice, *testBuffer, *memory, 0) != VK_SUCCESS) return tcu::TestStatus::fail("Bind buffer memory failed! (requested memory size: " + de::toString(size) + ")");