Commit 453a113a by Jamie Madill Committed by Commit Bot

Vulkan: Remove queue/device wait idle in favor of finish().

This change should aid further refactorings. In the future if we need to support waiting for individual queue idle we can add that back in a way that's supported by both synchronous and async queue operation. Bug: b/172704839 Change-Id: I9c9900ac81af60a37719439fe9db6135fcb17d46 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2525146 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent 6a39c8cc
......@@ -2311,43 +2311,6 @@ angle::Result RendererVk::queueSubmitOneOff(vk::Context *context,
return angle::Result::Continue;
}
angle::Result RendererVk::queueWaitIdle(vk::Context *context, egl::ContextPriority priority)
{
ANGLE_TRACE_EVENT0("gpu.angle", "RendererVk::queueWaitIdle");
if (getFeatures().asynchronousCommandProcessing.enabled)
{
// Wait for all pending commands to get sent before issuing vkQueueWaitIdle
waitForCommandProcessorIdle(context);
}
{
std::lock_guard<decltype(mQueueMutex)> lock(mQueueMutex);
ANGLE_VK_TRY(context, vkQueueWaitIdle(mQueues[priority]));
}
ANGLE_TRY(cleanupGarbage(false));
return angle::Result::Continue;
}
angle::Result RendererVk::deviceWaitIdle(vk::Context *context)
{
ANGLE_TRACE_EVENT0("gpu.angle", "RendererVk::deviceWaitIdle");
if (getFeatures().asynchronousCommandProcessing.enabled)
{
// Wait for all pending commands to get sent before issuing vkQueueWaitIdle
waitForCommandProcessorIdle(context);
}
{
std::lock_guard<decltype(mQueueMutex)> lock(mQueueMutex);
ANGLE_VK_TRY(context, vkDeviceWaitIdle(mDevice));
}
ANGLE_TRY(cleanupGarbage(false));
return angle::Result::Continue;
}
VkResult RendererVk::queuePresent(egl::ContextPriority priority,
const VkPresentInfoKHR &presentInfo)
{
......
......@@ -178,8 +178,6 @@ class RendererVk : angle::NonCopyable
vk::ResourceUseList &&resourceList,
const vk::Fence *fence,
Serial *serialOut);
angle::Result queueWaitIdle(vk::Context *context, egl::ContextPriority priority);
angle::Result deviceWaitIdle(vk::Context *context);
VkResult queuePresent(egl::ContextPriority priority, const VkPresentInfoKHR &presentInfo);
// This command buffer should be submitted immediately via queueSubmitOneOff.
......
......@@ -527,7 +527,7 @@ void WindowSurfaceVk::destroy(const egl::Display *display)
VkInstance instance = renderer->getInstance();
// flush the pipe.
(void)renderer->deviceWaitIdle(displayVk);
(void)renderer->finish(displayVk);
destroySwapChainImages(displayVk);
......@@ -803,7 +803,7 @@ angle::Result WindowSurfaceVk::recreateSwapchain(ContextVk *contextVk, const gl:
static constexpr size_t kMaxOldSwapchains = 5;
if (mOldSwapchains.size() > kMaxOldSwapchains)
{
ANGLE_TRY(contextVk->getRenderer()->queueWaitIdle(contextVk, contextVk->getPriority()));
ANGLE_TRY(contextVk->getRenderer()->finish(contextVk));
for (SwapchainCleanupData &oldSwapchain : mOldSwapchains)
{
oldSwapchain.destroy(contextVk->getDevice(), &mPresentSemaphoreRecycler);
......@@ -983,7 +983,7 @@ angle::Result WindowSurfaceVk::createSwapChain(vk::Context *context,
// that case as a workaround.
if (lastSwapchain && renderer->getFeatures().waitIdleBeforeSwapchainRecreation.enabled)
{
ANGLE_TRY(renderer->deviceWaitIdle(context));
ANGLE_TRY(renderer->finish(context));
}
// TODO(syoussefi): Once EGL_SWAP_BEHAVIOR_PRESERVED_BIT is supported, the contents of the old
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment