Commit 968df09e by Tim Van Patten Committed by Commit Bot

Treat VK_TIMEOUT as an error

The fence wait time was increased to 120 seconds, so we don't expect VK_TIMEOUT to be returned by a healty GPU. This change makes it so that when VK_TIMEOUT is returned, we will treat this as an error and propagate it to the GLES application as a GL_INVALID_OPERATION. It is expected that the GL application will re-initialize ANGLE which will also reinitialize the Vulkan device (and hopefully clean up the error). This is not our final design for ANGLE's VK_TIMEOUT handling, since we expect to expand our Vulkan device lost error handling when implementing the GLES 3.2 robustness requirements. This will likely improve ANGLE's VK_TIMEOUT handling as well. Bug: angleproject:4043 Test: Manually force VK_TIMEOUT (lower kMaxFenceWaitTimeNs) Change-Id: I2449ad214ada176014a1702a9b3417d4498d070f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1910722 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 0e5d019e
......@@ -407,13 +407,8 @@ bool CommandQueue::hasInFlightCommands() const
return !mInFlightCommands.empty();
}
angle::Result CommandQueue::finishToSerialOrTimeout(vk::Context *context,
Serial serial,
uint64_t timeout,
bool *outTimedOut)
angle::Result CommandQueue::finishToSerial(vk::Context *context, Serial serial, uint64_t timeout)
{
*outTimedOut = false;
if (mInFlightCommands.empty())
{
return angle::Result::Continue;
......@@ -434,15 +429,7 @@ angle::Result CommandQueue::finishToSerialOrTimeout(vk::Context *context,
// Wait for it finish
VkDevice device = context->getDevice();
VkResult status =
batch.fence.get().wait(device, context->getRenderer()->getMaxFenceWaitTimeNs());
// If timed out, report it as such.
if (status == VK_TIMEOUT)
{
*outTimedOut = true;
return angle::Result::Continue;
}
VkResult status = batch.fence.get().wait(device, timeout);
ANGLE_VK_TRY(context, status);
......@@ -3122,21 +3109,7 @@ angle::Result ContextVk::checkCompletedCommands()
angle::Result ContextVk::finishToSerial(Serial serial)
{
bool timedOut = false;
angle::Result result =
finishToSerialOrTimeout(serial, mRenderer->getMaxFenceWaitTimeNs(), &timedOut);
// Don't tolerate timeout. If such a large wait time results in timeout, something's wrong.
if (timedOut)
{
result = angle::Result::Stop;
}
return result;
}
angle::Result ContextVk::finishToSerialOrTimeout(Serial serial, uint64_t timeout, bool *outTimedOut)
{
return mCommandQueue.finishToSerialOrTimeout(this, serial, timeout, outTimedOut);
return mCommandQueue.finishToSerial(this, serial, mRenderer->getMaxFenceWaitTimeNs());
}
angle::Result ContextVk::getCompatibleRenderPass(const vk::RenderPassDesc &desc,
......
......@@ -65,10 +65,7 @@ class CommandQueue final : angle::NonCopyable
void clearAllGarbage(VkDevice device);
angle::Result finishToSerialOrTimeout(vk::Context *context,
Serial serial,
uint64_t timeout,
bool *outTimedOut);
angle::Result finishToSerial(vk::Context *context, Serial serial, uint64_t timeout);
angle::Result submitFrame(vk::Context *context,
const VkSubmitInfo &submitInfo,
......@@ -352,8 +349,6 @@ class ContextVk : public ContextImpl, public vk::Context, public vk::RenderPassO
// Wait for completion of batches until (at least) batch with given serial is finished.
angle::Result finishToSerial(Serial serial);
// A variant of finishToSerial that can time out. Timeout status returned in outTimedOut.
angle::Result finishToSerialOrTimeout(Serial serial, uint64_t timeout, bool *outTimedOut);
angle::Result getCompatibleRenderPass(const vk::RenderPassDesc &desc,
vk::RenderPass **renderPassOut);
......
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