Commit 2008c8ff by Michael Spang Committed by Commit Bot

Vulkan: Reuse flushImpl() from finishImpl()

Reuse flushing logic in finish() as there's an increasing amount of logic needed to submit work in order that would otherwise be duplicated. Bug: angleproject:3289 Change-Id: Ia489e285615ebaa48b01d8a202871bebf7de0ac2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1623813Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Michael Spang <spang@chromium.org>
parent f2a1c384
......@@ -2011,28 +2011,9 @@ angle::Result ContextVk::flushImpl()
angle::Result ContextVk::finishImpl()
{
if (!mCommandGraph.empty())
{
TRACE_EVENT0("gpu.angle", "ContextVk::finish");
vk::Scoped<vk::PrimaryCommandBuffer> commandBatch(getDevice());
ANGLE_TRY(flushCommandGraph(&commandBatch.get()));
const vk::Semaphore *waitSemaphore = nullptr;
const vk::Semaphore *signalSemaphore = nullptr;
if (mCurrentWindowSurface)
{
ANGLE_TRY(mCurrentWindowSurface->generateSemaphoresForFlush(this, &waitSemaphore,
&signalSemaphore));
}
VkSubmitInfo submitInfo = {};
VkPipelineStageFlags waitMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
InitializeSubmitInfo(&submitInfo, commandBatch.get(), waitSemaphore, &waitMask,
signalSemaphore);
TRACE_EVENT0("gpu.angle", "ContextVk::finish");
ANGLE_TRY(submitFrame(submitInfo, std::move(commandBatch.get())));
}
ANGLE_TRY(flushImpl());
ANGLE_TRY(finishToSerial(mLastSubmittedQueueSerial));
freeAllInFlightResources();
......
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