Commit 4b7bac78 by Jamie Madill Committed by Commit Bot

Vulkan: Throttle when way ahead of device.

This CL adds a fence wait when we get more than 100 serials behind the device. This fixes an ASSERT when unit tests or offscreen performance tests get way ahead of the device. Bug: angleproject:3630 Bug: angleproject:4281 Change-Id: I90f9af1b2ceb2b1cd9f2f638d6d84caaeeb83bb1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057351 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com>
parent efd2a669
...@@ -459,14 +459,16 @@ angle::Result CommandQueue::submitFrame(vk::Context *context, ...@@ -459,14 +459,16 @@ angle::Result CommandQueue::submitFrame(vk::Context *context,
mInFlightCommands.emplace_back(scopedBatch.release()); mInFlightCommands.emplace_back(scopedBatch.release());
// CPU should be throttled to avoid mInFlightCommands from growing too fast. That is done
// on swap() though, and there could be multiple submissions in between (through glFlush()
// calls), so the limit is larger than the expected number of images. The
// InterleavedAttributeDataBenchmark perf test for example issues a large number of flushes.
ASSERT(mInFlightCommands.size() <= kInFlightCommandsLimit);
ANGLE_TRY(checkCompletedCommands(context)); ANGLE_TRY(checkCompletedCommands(context));
// CPU should be throttled to avoid mInFlightCommands from growing too fast. Important for
// off-screen scenarios.
while (mInFlightCommands.size() > kInFlightCommandsLimit)
{
ANGLE_TRY(finishToSerial(context, mInFlightCommands[0].serial,
renderer->getMaxFenceWaitTimeNs()));
}
return angle::Result::Continue; return angle::Result::Continue;
} }
......
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