llvmpipe: move active_query assignment in lp_setup_begin_query()
authorBrian Paul <brianp@vmware.com>
Thu, 28 Apr 2011 13:38:53 +0000 (07:38 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 28 Apr 2011 13:51:55 +0000 (07:51 -0600)
If we run out of bin memory and do an early return from
lp_setup_begin_query() we'd omit setting the setup->active_query
pointer.  Then, when lp_setup_end_query() was later called, the
assertion for setup->active_query == pq would fail.  Moving the
assigment in lp_setup_begin_query() avoids that.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/drivers/llvmpipe/lp_setup.c

index c82ab821c7eb81008170e30fa89f6f6d634e4d45..5700918856b7d93632e36f5124a44e8b76b606b0 100644 (file)
@@ -1063,6 +1063,8 @@ lp_setup_begin_query(struct lp_setup_context *setup,
    /* init the query to its beginning state */
    assert(setup->active_query == NULL);
 
+   setup->active_query = pq;
+
    set_scene_state(setup, SETUP_ACTIVE, "begin_query");
    
    if (setup->scene) {
@@ -1080,8 +1082,6 @@ lp_setup_begin_query(struct lp_setup_context *setup,
          }
       }
    }
-
-   setup->active_query = pq;
 }