Disable automatic device resets when using reset notification.

TRAC #18607 Signed-off-by: Daniel Koch Authors: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/trunk@849 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4ff960d9
...@@ -537,7 +537,8 @@ EGLSurface Display::createWindowSurface(HWND window, EGLConfig config, const EGL ...@@ -537,7 +537,8 @@ EGLSurface Display::createWindowSurface(HWND window, EGLConfig config, const EGL
return error(EGL_BAD_ALLOC, EGL_NO_SURFACE); return error(EGL_BAD_ALLOC, EGL_NO_SURFACE);
} }
if (testDeviceLost()) { if (testDeviceLost())
{
if (!restoreLostDevice()) if (!restoreLostDevice())
return EGL_NO_SURFACE; return EGL_NO_SURFACE;
} }
...@@ -649,7 +650,8 @@ EGLSurface Display::createOffscreenSurface(EGLConfig config, HANDLE shareHandle, ...@@ -649,7 +650,8 @@ EGLSurface Display::createOffscreenSurface(EGLConfig config, HANDLE shareHandle,
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE); return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
} }
if (testDeviceLost()) { if (testDeviceLost())
{
if (!restoreLostDevice()) if (!restoreLostDevice())
return EGL_NO_SURFACE; return EGL_NO_SURFACE;
} }
...@@ -693,6 +695,12 @@ EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *sha ...@@ -693,6 +695,12 @@ EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *sha
bool Display::restoreLostDevice() bool Display::restoreLostDevice()
{ {
for (ContextSet::iterator ctx = mContextSet.begin(); ctx != mContextSet.end(); ctx++)
{
if ((*ctx)->isResetNotificationEnabled())
return false; // If reset notifications have been requested, application must delete all contexts first
}
// Release surface resources to make the Reset() succeed // Release surface resources to make the Reset() succeed
for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++) for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++)
{ {
......
...@@ -866,7 +866,10 @@ EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLConte ...@@ -866,7 +866,10 @@ EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLConte
EGLContext context = display->createContext(config, static_cast<gl::Context*>(share_context), reset_notification, robust_access); EGLContext context = display->createContext(config, static_cast<gl::Context*>(share_context), reset_notification, robust_access);
if (context)
return success(context); return success(context);
else
return error(EGL_CONTEXT_LOST, EGL_NO_CONTEXT);
} }
catch(std::bad_alloc&) catch(std::bad_alloc&)
{ {
......
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