From 4f70887d348a4eea433df39496a5fe53d64b439a Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Fri, 3 Feb 2017 10:23:39 -0500 Subject: Have Skia Vulkan backend support wait-for-gpu flag on tests So trying to mimic what the EglManager does in the fence call. Technically there are two logical queues I could wait on for the device, the graphics queue and the present queue. Waiting on the device waits for both these queues to finish. It wasn't obvious to me if the EGL was waiting for just graphics work or both queues, so I went for both (by waiting on device). However, so far every device we've seen in Vulkan has the present and graphics queue combined on the physical device so waiting for one or both should really be different. Test: Manual ran macrobench in skiavk and more realistic values compared to not waiting for gpu. Change-Id: I17cde70c677a9ad1b6bf9bc9ca4fd5f8f3b807e3 --- libs/hwui/renderthread/VulkanManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs/hwui/renderthread') diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp index 454ce4d9e8ff..c2c2f2239c7f 100644 --- a/libs/hwui/renderthread/VulkanManager.cpp +++ b/libs/hwui/renderthread/VulkanManager.cpp @@ -603,6 +603,11 @@ static VkAccessFlags layoutToSrcAccessMask(const VkImageLayout layout) { } void VulkanManager::swapBuffers(VulkanSurface* surface) { + if (CC_UNLIKELY(Properties::waitForGpuCompletion)) { + ATRACE_NAME("Finishing GPU work"); + mDeviceWaitIdle(mBackendContext->fDevice); + } + VulkanSurface::BackbufferInfo* backbuffer = surface->mBackbuffers + surface->mCurrentBackbufferIndex; GrVkImageInfo* imageInfo; -- cgit v1.2.3-59-g8ed1b