From 8d2c15745a7118ae3dab7e20e046257a66fc46a5 Mon Sep 17 00:00:00 2001 From: "kbr@chromium.org" Date: Wed, 13 Jul 2011 22:05:49 +0000 Subject: Detect and expose loss of OpenGL context using GL_ARB_robustness. This initial patch changes the Linux port to use GLX_ARB_create_context_robustness when available, and tests periodically whether the context has been lost after each draw call and when making the context current. The detection of context loss also works with EGL and ANGLE, although it always reports an unknown reset status. WebKit changes will follow which test the reset status and determine what to do in response; for example, the policy might be to never restore a WebGL context which was lost (due to a GPU reset) and which was determined to be the guilty context. Tested manually with WebGL stress tests and verified on Linux and Windows that in at least some situations it is possible to detect guilty contexts and shut down the associated WebGL application. Some precision of this detection was recently lost and will need to be fixed in following CLs. Also updated and ran GPU unit tests. BUG=88106 TEST=none (tested manually; try servers) Review URL: http://codereview.chromium.org/7331020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92429 0039d316-1c4b-4281-b951-d872f2087c98 --- gpu/GLES2/gl2ext.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gpu/GLES2') diff --git a/gpu/GLES2/gl2ext.h b/gpu/GLES2/gl2ext.h index 7ad5ef1..1afb408 100644 --- a/gpu/GLES2/gl2ext.h +++ b/gpu/GLES2/gl2ext.h @@ -1010,6 +1010,26 @@ typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOCHROMIUM) (); #endif #endif +/* GL_ARB_robustness */ +/* This extension is subsetted for the moment, incorporating only the + * enums necessary to describe the reasons that we might encounter for + * losing the context. The entry point querying the reset status is + * not yet incorporated; to do so, a spec will be needed of a GLES2 + * subset of GL_ARB_robustness. + */ +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 +#ifndef GL_GUILTY_CONTEXT_RESET_ARB +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#endif +#ifndef GL_INNOCENT_CONTEXT_RESET_ARB +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#endif +#ifndef GL_UNKNOWN_CONTEXT_RESET_ARB +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#endif +#endif + #ifdef __cplusplus } #endif -- cgit v1.1