From: Kenneth Graunke Date: Tue, 26 Feb 2013 07:31:10 +0000 (-0800) Subject: i965: Turn if (query->bo) into an assertion. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=614944b8975ce9827b26b92f42ad8b48493eb7f0;p=mesa.git i965: Turn if (query->bo) into an assertion. The code a few lines above calls brw_emit_query_begin() if !query->bo, and that creates query->bo. So it should always be non-NULL. Signed-off-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c index 0881ab93893..0cdfa6e486b 100644 --- a/src/mesa/drivers/dri/i965/brw_queryobj.c +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c @@ -404,12 +404,12 @@ brw_end_query(struct gl_context *ctx, struct gl_query_object *q) brw_emit_query_begin(brw); } - if (query->bo) { - brw_emit_query_end(brw); + assert(query->bo); - drm_intel_bo_unreference(brw->query.bo); - brw->query.bo = NULL; - } + brw_emit_query_end(brw); + + drm_intel_bo_unreference(brw->query.bo); + brw->query.bo = NULL; brw->query.obj = NULL;