struct gl_perf_query_object *m = data;
struct gl_context *ctx = user;
+ /* Don't confuse the implementation by deleting an active query. We can
+ * toggle Active/Used to false because we're tearing down the GL context
+ * and it's already idle (see _mesa_free_context_data).
+ */
+ m->Active = false;
+ m->Used = false;
ctx->Driver.DeletePerfQuery(ctx, m);
}
*/
*bytesWritten = 0;
+ /* Not explicitly covered in the spec but a query that was never started
+ * cannot return any data.
+ */
+ if (!obj->Used) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetPerfQueryDataINTEL(query never began)");
+ return;
+ }
+
/* Not explicitly covered in the spec but to be consistent with
* EndPerfQuery which validates that an application only ends an
* active query we also validate that an application doesn't try