aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/getstring.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-11-08 13:12:15 +0100
committermarha <marha@users.sourceforge.net>2013-11-08 13:12:15 +0100
commitf707ea3ce065f0ce40f586c40283fab42059b485 (patch)
tree055a5ccdecaec105365d1de9a90d7d6b38f257fb /mesalib/src/mesa/main/getstring.c
parentc8483dc2831dc37d93a36804022f6b064f5962ea (diff)
parent09e94a8e392e8fe6fd89ddefbf3897a92e525b5b (diff)
downloadvcxsrv-f707ea3ce065f0ce40f586c40283fab42059b485.tar.gz
vcxsrv-f707ea3ce065f0ce40f586c40283fab42059b485.tar.bz2
vcxsrv-f707ea3ce065f0ce40f586c40283fab42059b485.zip
Merge remote-tracking branch 'origin/released'
* origin/released: Added presentproto-1.0 libxtrans libxcb xcb-proto mesa git update 8 nov 2013 Conflicts: X11/xtrans/Xtransint.h X11/xtrans/Xtranssock.c libxcb/src/.gitignore mesalib/src/mesa/drivers/dri/common/dri_util.c
Diffstat (limited to 'mesalib/src/mesa/main/getstring.c')
-rw-r--r--mesalib/src/mesa/main/getstring.c49
1 files changed, 44 insertions, 5 deletions
diff --git a/mesalib/src/mesa/main/getstring.c b/mesalib/src/mesa/main/getstring.c
index 0e075427f..d8189115a 100644
--- a/mesalib/src/mesa/main/getstring.c
+++ b/mesalib/src/mesa/main/getstring.c
@@ -23,7 +23,7 @@
*/
-
+#include <stdbool.h>
#include "glheader.h"
#include "context.h"
#include "get.h"
@@ -305,11 +305,50 @@ GLenum GLAPIENTRY
_mesa_GetGraphicsResetStatusARB( void )
{
GET_CURRENT_CONTEXT(ctx);
- GLenum status = ctx->ResetStatus;
+ GLenum status = GL_NO_ERROR;
+
+ /* The ARB_robustness specification says:
+ *
+ * "If the reset notification behavior is NO_RESET_NOTIFICATION_ARB,
+ * then the implementation will never deliver notification of reset
+ * events, and GetGraphicsResetStatusARB will always return NO_ERROR."
+ */
+ if (ctx->Const.ResetStrategy == GL_NO_RESET_NOTIFICATION_ARB) {
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx,
+ "glGetGraphicsResetStatusARB always returns GL_NO_ERROR "
+ "because reset notifictation was not requested at context "
+ "creation.\n");
+
+ return GL_NO_ERROR;
+ }
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glGetGraphicsResetStatusARB"
- "(always returns GL_NO_ERROR)\n");
+ if (ctx->Driver.GetGraphicsResetStatus) {
+ /* Query the reset status of this context from the driver core.
+ */
+ status = ctx->Driver.GetGraphicsResetStatus(ctx);
+
+ _glthread_LOCK_MUTEX(ctx->Shared->Mutex);
+
+ /* If this context has not been affected by a GPU reset, check to see if
+ * some other context in the share group has been affected by a reset.
+ * If another context saw a reset but this context did not, assume that
+ * this context was not guilty.
+ */
+ if (status != GL_NO_ERROR) {
+ ctx->Shared->ShareGroupReset = true;
+ } else if (ctx->Shared->ShareGroupReset && !ctx->ShareGroupReset) {
+ status = GL_INNOCENT_CONTEXT_RESET_ARB;
+ }
+
+ ctx->ShareGroupReset = ctx->Shared->ShareGroupReset;
+ _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
+ }
+
+ if (!ctx->Driver.GetGraphicsResetStatus && (MESA_VERBOSE & VERBOSE_API))
+ _mesa_debug(ctx,
+ "glGetGraphicsResetStatusARB always returns GL_NO_ERROR "
+ "because the driver doesn't track reset status.\n");
return status;
}