i965: propagate error from gen_perf_begin_query to glBeginPerfQueryINTEL
authorMarcin Ślusarz <marcin.slusarz@intel.com>
Tue, 28 Jul 2020 09:55:16 +0000 (11:55 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Jul 2020 10:44:41 +0000 (10:44 +0000)
Otherwise mesa will crash in glEndPerfQueryINTEL because OA BO is NULL.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6094>

src/mesa/drivers/dri/i965/brw_performance_query.c

index ab2f200a1faa4784c8d2e44ac39ba19213d1b827..6c74403da6c1ae3912959c9dd7af80f087e52e97 100644 (file)
@@ -247,12 +247,12 @@ brw_begin_perf_query(struct gl_context *ctx,
 
    DBG("Begin(%d)\n", o->Id);
 
-   gen_perf_begin_query(perf_ctx, obj);
+   bool ret = gen_perf_begin_query(perf_ctx, obj);
 
    if (INTEL_DEBUG & DEBUG_PERFMON)
       dump_perf_queries(brw);
 
-   return true;
+   return ret;
 }
 
 /**