Changed two assertions to explicit tests, and added an error code to
those checked during ReadPixels. These changes are needed to avoid
having ANGLE assert in debug builds when running WebGL test cases
which provoke a GPU reset.
BUG=none
TEST=slow-shader-example and lots-of-polys-example in WebGL test suite
Review URL: http://codereview.appspot.com/4684042
git-svn-id: https://angleproject.googlecode.com/svn/trunk@703 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libEGL/Display.cpp b/src/libEGL/Display.cpp
index 1d64f9a..ac51af2 100644
--- a/src/libEGL/Display.cpp
+++ b/src/libEGL/Display.cpp
@@ -297,8 +297,11 @@
if (!mSceneStarted)
{
long result = mDevice->BeginScene();
- ASSERT(SUCCEEDED(result));
- mSceneStarted = true;
+ if (SUCCEEDED(result)) {
+ // This is defensive checking against the device being
+ // lost at unexpected times.
+ mSceneStarted = true;
+ }
}
}
@@ -306,8 +309,9 @@
{
if (mSceneStarted)
{
- long result = mDevice->EndScene();
- ASSERT(SUCCEEDED(result));
+ // EndScene can fail if the device was lost, for example due
+ // to a TDR during a draw call.
+ mDevice->EndScene();
mSceneStarted = false;
}
}