Commit 4398b2b6 by Brandon Schade Committed by Commit Bot

Vulkan: finishToSerial only if the buffer is in use

The call to flushImpl() was conditioned on the buffer being used but the call to finishToSerial() was outside. This caused an unconditional wait and unnecessary pipeline stall. The fix is to make sure to perform a flush and wait only when the buffer is in use. Bug: angleproject:3994 Change-Id: I1b297cf11a67f7611d37808cb111d6b52ac16f90 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1854881 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent f912b294
......@@ -221,9 +221,10 @@ angle::Result BufferVk::mapRangeImpl(ContextVk *contextVk,
if (mBuffer.isResourceInUse(contextVk))
{
ANGLE_TRY(contextVk->flushImpl(nullptr));
// Make sure the GPU is done with the buffer.
ANGLE_TRY(contextVk->finishToSerial(mBuffer.getLatestSerial()));
}
// Make sure the GPU is done with the buffer.
ANGLE_TRY(contextVk->finishToSerial(mBuffer.getLatestSerial()));
ASSERT(!mBuffer.isResourceInUse(contextVk));
}
......
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