[Mesa-dev] [PATCH 5/7] i965: Remove software geometry query code.

Kenneth Graunke kenneth at whitecape.org
Mon May 20 15:54:35 PDT 2013


EXT_transform_feedback isn't yet supported on Gen4-5, so none of this
query code is actually used.  This also means we can remove some of the
surrounding support code.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: Eric Anholt <eric at anholt.net>
Cc: Paul Berry <stereotype441 at gmail.com>
---
 src/mesa/drivers/dri/i965/brw_context.h           |  4 --
 src/mesa/drivers/dri/i965/brw_draw.c              |  4 --
 src/mesa/drivers/dri/i965/brw_primitive_restart.c | 11 -----
 src/mesa/drivers/dri/i965/brw_queryobj.c          | 52 -----------------------
 4 files changed, 71 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 8587dd0..97caccd 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1088,10 +1088,6 @@ struct brw_context
    struct brw_sol_state {
       uint32_t svbi_0_starting_index;
       uint32_t svbi_0_max_index;
-      uint32_t primitives_generated;
-      uint32_t primitives_written;
-      bool counting_primitives_generated;
-      bool counting_primitives_written;
    } sol;
 
    uint32_t render_target_format[MESA_FORMAT_COUNT];
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 8c37e0b..4dd185e 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -386,7 +386,6 @@ brw_update_primitive_count(struct brw_context *brw,
    uint32_t count
       = vbo_count_tessellated_primitives(prim->mode, prim->count,
                                          prim->num_instances);
-   brw->sol.primitives_generated += count;
    if (_mesa_is_xfb_active_and_unpaused(&brw->intel.ctx)) {
       /* Update brw->sol.svbi_0_max_index to reflect the amount by which the
        * hardware is going to increment SVBI 0 when this drawing operation
@@ -400,9 +399,6 @@ brw_update_primitive_count(struct brw_context *brw,
          (brw->sol.svbi_0_max_index - brw->sol.svbi_0_starting_index) / verts;
       uint32_t primitives_written = MIN2 (space_avail, count);
       brw->sol.svbi_0_starting_index += verts * primitives_written;
-
-      /* And update the TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN query. */
-      brw->sol.primitives_written += primitives_written;
    }
 }
 
diff --git a/src/mesa/drivers/dri/i965/brw_primitive_restart.c b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
index 10581b3..f824915 100644
--- a/src/mesa/drivers/dri/i965/brw_primitive_restart.c
+++ b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
@@ -73,17 +73,6 @@ can_cut_index_handle_prims(struct gl_context *ctx,
                            const struct _mesa_index_buffer *ib)
 {
    struct intel_context *intel = intel_context(ctx);
-   struct brw_context *brw = brw_context(ctx);
-
-   if (brw->sol.counting_primitives_generated ||
-       brw->sol.counting_primitives_written) {
-      /* Counting primitives generated in hardware is not currently
-       * supported, so take the software path. We need to investigate
-       * the *_PRIMITIVES_COUNT registers to allow this to be handled
-       * entirely in hardware.
-       */
-      return false;
-   }
 
    /* Otherwise Haswell can do it all. */
    if (intel->is_haswell)
diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
index 8579993..985dbed 100644
--- a/src/mesa/drivers/dri/i965/brw_queryobj.c
+++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
@@ -187,14 +187,6 @@ brw_queryobj_get_results(struct gl_context *ctx,
       }
       break;
 
-   case GL_PRIMITIVES_GENERATED:
-   case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
-      /* We don't actually query the hardware for this value, so query->bo
-       * should always be NULL and execution should never reach here.
-       */
-      assert(!"Unreachable");
-      break;
-
    default:
       assert(!"Unrecognized query target in brw_queryobj_get_results()");
       break;
@@ -305,22 +297,6 @@ brw_begin_query(struct gl_context *ctx, struct gl_query_object *q)
       brw->state.dirty.brw |= BRW_NEW_STATS_WM;
       break;
 
-   case GL_PRIMITIVES_GENERATED:
-      /* We don't actually query the hardware for this value; we keep track of
-       * it a software counter.  So just reset the counter.
-       */
-      brw->sol.primitives_generated = 0;
-      brw->sol.counting_primitives_generated = true;
-      break;
-
-   case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
-      /* We don't actually query the hardware for this value; we keep track of
-       * it a software counter.  So just reset the counter.
-       */
-      brw->sol.primitives_written = 0;
-      brw->sol.counting_primitives_written = true;
-      break;
-
    default:
       assert(!"Unrecognized query target in brw_begin_query()");
       break;
@@ -380,34 +356,6 @@ brw_end_query(struct gl_context *ctx, struct gl_query_object *q)
       brw->state.dirty.brw |= BRW_NEW_STATS_WM;
       break;
 
-   case GL_PRIMITIVES_GENERATED:
-      /* We don't actually query the hardware for this value; we keep track of
-       * it in a software counter.  So just read the counter and store it in
-       * the query object.
-       */
-      query->Base.Result = brw->sol.primitives_generated;
-      brw->sol.counting_primitives_generated = false;
-
-      /* And set query->bo to NULL so that this query won't try to wait
-       * for any rendering to complete.
-       */
-      query->bo = NULL;
-      break;
-
-   case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
-      /* We don't actually query the hardware for this value; we keep track of
-       * it in a software counter.  So just read the counter and store it in
-       * the query object.
-       */
-      query->Base.Result = brw->sol.primitives_written;
-      brw->sol.counting_primitives_written = false;
-
-      /* And set query->bo to NULL so that this query won't try to wait
-       * for any rendering to complete.
-       */
-      query->bo = NULL;
-      break;
-
    default:
       assert(!"Unrecognized query target in brw_end_query()");
       break;
-- 
1.8.2.3



More information about the mesa-dev mailing list