[Mesa-dev] [PATCH 2/4] i965: Merge brw_prepare_query_begin() and brw_emit_query_begin().

Eric Anholt eric at anholt.net
Tue Oct 23 13:25:09 PDT 2012


This is a leftover from when we had to split those two functions due to the
separate BO validation step.
---
 src/mesa/drivers/dri/i965/brw_context.h     |    1 -
 src/mesa/drivers/dri/i965/brw_draw_upload.c |    5 +----
 src/mesa/drivers/dri/i965/brw_queryobj.c    |   23 ++++++-----------------
 3 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index eca1d45..9232a72 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1138,7 +1138,6 @@ void brw_workaround_depthstencil_alignment(struct brw_context *brw);
  * brw_queryobj.c
  */
 void brw_init_queryobj_functions(struct dd_function_table *functions);
-void brw_prepare_query_begin(struct brw_context *brw);
 void brw_emit_query_begin(struct brw_context *brw);
 void brw_emit_query_end(struct brw_context *brw);
 
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index f5f65ca..4a4237d 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -397,7 +397,7 @@ static void brw_prepare_vertices(struct brw_context *brw)
       return;
 
    if (brw->vb.nr_buffers)
-      goto prepare;
+      return;
 
    for (i = j = 0; i < brw->vb.nr_enabled; i++) {
       struct brw_vertex_element *input = brw->vb.enabled[i];
@@ -565,9 +565,6 @@ static void brw_prepare_vertices(struct brw_context *brw)
    }
 
    brw->vb.nr_buffers = j;
-
-prepare:
-   brw_prepare_query_begin(brw);
 }
 
 static void brw_emit_vertices(struct brw_context *brw)
diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
index 0e42f39..ff873ae 100644
--- a/src/mesa/drivers/dri/i965/brw_queryobj.c
+++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
@@ -392,14 +392,16 @@ static void brw_check_query(struct gl_context *ctx, struct gl_query_object *q)
    }
 }
 
-/** Called to set up the query BO and account for its aperture space */
+/** Called just before primitive drawing to get a beginning PS_DEPTH_COUNT. */
 void
-brw_prepare_query_begin(struct brw_context *brw)
+brw_emit_query_begin(struct brw_context *brw)
 {
    struct intel_context *intel = &brw->intel;
+   struct gl_context *ctx = &intel->ctx;
+   struct brw_query_object *query = brw->query.obj;
 
-   /* Skip if we're not doing any queries. */
-   if (!brw->query.obj)
+   /* Skip if we're not doing any queries, or we've emitted the start. */
+   if (!query || brw->query.begin_emitted)
       return;
 
    /* Get a new query BO if we're going to need it. */
@@ -417,19 +419,6 @@ brw_prepare_query_begin(struct brw_context *brw)
 
       brw->query.index = 0;
    }
-}
-
-/** Called just before primitive drawing to get a beginning PS_DEPTH_COUNT. */
-void
-brw_emit_query_begin(struct brw_context *brw)
-{
-   struct intel_context *intel = &brw->intel;
-   struct gl_context *ctx = &intel->ctx;
-   struct brw_query_object *query = brw->query.obj;
-
-   /* Skip if we're not doing any queries, or we've emitted the start. */
-   if (!query || brw->query.begin_emitted)
-      return;
 
    write_depth_count(intel, brw->query.bo, brw->query.index * 2);
 
-- 
1.7.10.4



More information about the mesa-dev mailing list