Mesa (master): llvmpipe: move active_query assignment in lp_setup_begin_query()

Brian Paul brianp at kemper.freedesktop.org
Thu Apr 28 06:52:29 PDT 2011


Module: Mesa
Branch: master
Commit: 284191560b191ebb2219e0f5fe2de4128ad172a5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=284191560b191ebb2219e0f5fe2de4128ad172a5

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Apr 28 07:38:53 2011 -0600

llvmpipe: move active_query assignment in lp_setup_begin_query()

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 at vmware.com>

---

 src/gallium/drivers/llvmpipe/lp_setup.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index c82ab82..5700918 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -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;
 }
 
 



More information about the mesa-commit mailing list