Commit 23196076 by Geoff Lang Committed by Commit Bot

GL: Protect against infinite loops with CONTEXT_LOST in CheckError

If the GL context generates a CONTEXT_LOST error, stop checking for errors. This error will be generated continuously and result in an infinite loop. BUG=angleproject:3020 Change-Id: Ib78d1ff3f84103e658307f2f892538700916449d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2142312Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 9f14f785
......@@ -1965,9 +1965,11 @@ angle::Result CheckError(const gl::Context *context,
ERR() << "GL call " << call << " generated error " << gl::FmtHex(error) << " in " << file
<< ", " << function << ":" << line << ". ";
// Check that only one GL error was generated, ClearErrors should have been called first
// Check that only one GL error was generated, ClearErrors should have been called first.
// Skip GL_CONTEXT_LOST errors, they will be generated continuously and result in an
// infinite loop.
GLenum nextError = functions->getError();
while (nextError != GL_NO_ERROR)
while (nextError != GL_NO_ERROR && nextError != GL_CONTEXT_LOST)
{
ERR() << "Additional GL error " << gl::FmtHex(nextError) << " generated.";
nextError = functions->getError();
......
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