Commit 0359b697 by Omar El Sheikh Committed by Commit Bot

Vulkan: Check mInFlightCommands doesn't grow too fast

The mInFlightCommand vector could grow faster than the GPU can complete tasks. Check for this edge case and give the GPU a chance to catch up with work. Also allows us to enable performance tests for Draw Calls on vulkan since it was affected by this limit check before. Bug: angleproject:2742 Change-Id: I66a86ea6b5300fa3d74b07dc341aa597824b5f09 Reviewed-on: https://chromium-review.googlesource.com/1147607Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent faf50849
......@@ -33,6 +33,7 @@ namespace
const uint32_t kMockVendorID = 0xba5eba11;
const uint32_t kMockDeviceID = 0xf005ba11;
constexpr char kMockDeviceName[] = "Vulkan Mock Device";
constexpr size_t kInFlightCommandsLimit = 50000u;
} // anonymous namespace
namespace rx
......@@ -807,8 +808,12 @@ angle::Result RendererVk::submitFrame(vk::Context *context,
mInFlightCommands.emplace_back(scopedBatch.release());
// Sanity check.
ASSERT(mInFlightCommands.size() < 1000u);
// Check that mInFlightCommands isn't growing too fast
// If it is, wait for the queue to complete work it has alread been assigned
if (mInFlightCommands.size() > kInFlightCommandsLimit)
{
vkQueueWaitIdle(mQueue);
}
// Increment the queue serial. If this fails, we should restart ANGLE.
// TODO(jmadill): Overflow check.
......
......@@ -189,5 +189,9 @@ ANGLE_INSTANTIATE_TEST(DrawCallPerfBenchmark,
DrawArrays(DrawCallPerfOpenGLOrGLESParams(true, false), false),
DrawArrays(DrawCallPerfOpenGLOrGLESParams(true, true), false),
DrawArrays(DrawCallPerfOpenGLOrGLESParams(true, false), true),
DrawArrays(DrawCallPerfValidationOnly(), false));
DrawArrays(DrawCallPerfValidationOnly(), false),
DrawArrays(DrawCallPerfVulkanParams(true, false), true),
DrawArrays(DrawCallPerfVulkanParams(true, false), false),
DrawArrays(DrawCallPerfVulkanParams(false, false), false),
DrawArrays(DrawCallPerfVulkanParams(false, false), true));
} // namespace
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