mesa: add DisjointOperation to gl_shared_state
authorTapani Pälli <tapani.palli@intel.com>
Mon, 20 Nov 2017 06:31:40 +0000 (08:31 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Fri, 15 Dec 2017 06:42:48 +0000 (08:42 +0200)
This state will be used by EXT_disjoint_timer_query. As first
usage, patch sets DisjointOperation true when gpu reset happens.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/mtypes.h
src/mesa/main/robustness.c

index b372921e9f09c7eda3e1b5ccda745acd417b2589..0aac49402e8de8a126ee82f32ed95f0266ec2504 100644 (file)
@@ -3310,6 +3310,14 @@ struct gl_shared_state
    /** EXT_external_objects */
    struct _mesa_HashTable *MemoryObjects;
 
+   /**
+    * Some context in this share group was affected by a disjoint
+    * operation. This operation can be anything that has effects on
+    * values of timer queries in such manner that they become invalid for
+    * performance metrics. As example gpu reset, counter overflow or gpu
+    * frequency changes.
+    */
+   bool DisjointOperation;
 };
 
 
index a61c07f125f072ebd9d0ade9b99aab74e7cbeafb..e7d7007da4865c5fff66a5a7bdecc568a6b68cfc 100644 (file)
@@ -145,6 +145,7 @@ _mesa_GetGraphicsResetStatusARB( void )
        */
       if (status != GL_NO_ERROR) {
          ctx->Shared->ShareGroupReset = true;
+         ctx->Shared->DisjointOperation = true;
       } else if (ctx->Shared->ShareGroupReset && !ctx->ShareGroupReset) {
          status = GL_INNOCENT_CONTEXT_RESET_ARB;
       }