summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/VulkanManager.cpp
diff options
context:
space:
mode:
authorGreg Daniel <egdaniel@google.com>2017-02-03 10:23:39 -0500
committerGreg Daniel <egdaniel@google.com>2017-02-03 10:28:52 -0500
commit4f70887d348a4eea433df39496a5fe53d64b439a (patch)
treefd89a90c3351f0a5d6f726c15304e42aef8978ec /libs/hwui/renderthread/VulkanManager.cpp
parent8e332cc54b203a3fe7a014e506c3fcc07a60e539 (diff)
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
Diffstat (limited to 'libs/hwui/renderthread/VulkanManager.cpp')
-rw-r--r--libs/hwui/renderthread/VulkanManager.cpp5
1 files changed, 5 insertions, 0 deletions
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;