mesa: Add gl_shared_state::ShareGroupReset and gl_context::ShareGroupReset
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 6 Sep 2012 05:30:43 +0000 (22:30 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 8 Nov 2013 00:41:38 +0000 (16:41 -0800)
These will be used to determine whether to signal a GPU reset after
another context in the share group has observed a reset.

v2: Change ShareGroupReset from GLboolean to bool.  Suggested by Brian.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/context.c
src/mesa/main/mtypes.h

index 913f409e4161116022fea9360fc6e49be8e878cd..d005d23706844776ba432ec478da8ea0062ea27a 100644 (file)
@@ -808,6 +808,7 @@ init_attrib_groups(struct gl_context *ctx)
    ctx->NewState = _NEW_ALL;
    ctx->NewDriverState = ~0;
    ctx->ErrorValue = GL_NO_ERROR;
+   ctx->ShareGroupReset = false;
    ctx->varying_vp_inputs = VERT_BIT_ALL;
 
    return GL_TRUE;
index 0e5bcc9e40f916a83aaa750fd1dfebe7eb9c2698..ae96e2326cad1745a06d5c2570f3f9706cbd4a3d 100644 (file)
@@ -35,6 +35,7 @@
 
 
 #include <stdint.h>             /* uint32_t */
+#include <stdbool.h>
 
 #include "main/glheader.h"
 #include "main/config.h"
@@ -2812,6 +2813,17 @@ struct gl_shared_state
 
    /** GL_ARB_sampler_objects */
    struct _mesa_HashTable *SamplerObjects;
+
+   /**
+    * Some context in this share group was affected by a GPU reset
+    *
+    * On the next call to \c glGetGraphicsResetStatus, contexts that have not
+    * been affected by a GPU reset must also return
+    * \c GL_INNOCENT_CONTEXT_RESET_ARB.
+    *
+    * Once this field becomes true, it is never reset to false.
+    */
+   bool ShareGroupReset;
 };
 
 
@@ -3967,6 +3979,13 @@ struct gl_context
    const void *vdpGetProcAddress;
    struct set *vdpSurfaces;
    /*@}*/
+
+   /**
+    * Has this context observed a GPU reset in any context in the share group?
+    *
+    * Once this field becomes true, it is never reset to false.
+    */
+   GLboolean ShareGroupReset;
 };