i965: Remove pointless NULL check from Gen6 primitive counting code.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 17 Mar 2017 00:20:10 +0000 (17:20 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 24 Mar 2017 19:21:06 +0000 (12:21 -0700)
We create the BO when creating a transform feedback object, and only
destroy it when deleting that object.  So it won't be NULL.

CID: 1401410

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/gen6_sol.c

index d117e1c0eca8332b5776a4a6fa70cf8e36091ad3..b769a715f02cfd6c361a2161b63137d5e8c5c8b5 100644 (file)
@@ -284,9 +284,10 @@ brw_save_primitives_written_counters(struct brw_context *brw,
    const struct gl_context *ctx = &brw->ctx;
    const int streams = ctx->Const.MaxVertexStreams;
 
+   assert(obj->prim_count_bo != NULL);
+
    /* Check if there's enough space for a new pair of four values. */
-   if (obj->prim_count_bo != NULL &&
-       obj->prim_count_buffer_index + 2 * streams >= 4096 / sizeof(uint64_t)) {
+   if (obj->prim_count_buffer_index + 2 * streams >= 4096 / sizeof(uint64_t)) {
       /* Gather up the results so far and release the BO. */
       tally_prims_generated(brw, obj);
    }