i965: Turn if (query->bo) into an assertion.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 26 Feb 2013 07:31:10 +0000 (23:31 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 2 Mar 2013 06:09:04 +0000 (22:09 -0800)
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 <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_queryobj.c

index 0881ab93893a3ba0480f6918ffce37a37d2effad..0cdfa6e486b21fe9a40703f1b3025a0e6196672f 100644 (file)
@@ -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;