summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_draw.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-05-17 11:53:53 -0700
committerKenneth Graunke <kenneth@whitecape.org>2013-05-21 13:29:27 -0700
commit64a87f29ce29d3c2e01b7fd79386bf6ace454f62 (patch)
treeae20d2a93f5255582b157a6c02ba3531a8b263ad /src/mesa/drivers/dri/i965/brw_draw.c
parent647fc0c50bc9832c336b2b7e4329abec31df9dec (diff)
downloadexternal_mesa3d-64a87f29ce29d3c2e01b7fd79386bf6ace454f62.zip
external_mesa3d-64a87f29ce29d3c2e01b7fd79386bf6ace454f62.tar.gz
external_mesa3d-64a87f29ce29d3c2e01b7fd79386bf6ace454f62.tar.bz2
i965: Kill software primitive counting entirely.
Now that we have hardware contexts, we don't need to continually reprogram the GS_SVBI_INDEX registers. They're automatically saved and restored with the context, so they can just increment over time. We only need to reset them when starting transform feedback. There's also no reason to delay until the next drawing operation; we can just emit the packet immediately. However, this means we must drop the initialization in brw_invariant_state, as BeginTransformFeedback may occur before the first drawing in a context. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_draw.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 4dd185e..657d6ee 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -351,57 +351,6 @@ static void brw_postdraw_set_buffers_need_resolve(struct brw_context *brw)
intel_renderbuffer_set_needs_depth_resolve(depth_irb);
}
-static int
-verts_per_prim(GLenum mode)
-{
- switch (mode) {
- case GL_POINTS:
- return 1;
- case GL_LINE_STRIP:
- case GL_LINE_LOOP:
- case GL_LINES:
- return 2;
- case GL_TRIANGLE_STRIP:
- case GL_TRIANGLE_FAN:
- case GL_POLYGON:
- case GL_TRIANGLES:
- case GL_QUADS:
- case GL_QUAD_STRIP:
- return 3;
- default:
- _mesa_problem(NULL,
- "unknown prim type in transform feedback primitive count");
- return 0;
- }
-}
-
-/**
- * Update internal counters based on the the drawing operation described in
- * prim.
- */
-static void
-brw_update_primitive_count(struct brw_context *brw,
- const struct _mesa_prim *prim)
-{
- uint32_t count
- = vbo_count_tessellated_primitives(prim->mode, prim->count,
- prim->num_instances);
- 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
- * occurs. This is necessary because the kernel does not (yet) save and
- * restore GPU registers when context switching, so we'll need to be
- * able to reload SVBI 0 with the correct value in case we have to start
- * a new batch buffer.
- */
- unsigned verts = verts_per_prim(prim->mode);
- uint32_t space_avail =
- (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;
- }
-}
-
/* May fail if out of video memory for texture or vbo upload, or on
* fallback conditions.
*/
@@ -524,9 +473,6 @@ retry:
}
}
}
-
- if (!_mesa_meta_in_progress(ctx))
- brw_update_primitive_count(brw, &prim[i]);
}
if (intel->always_flush_batch)