diff options
author | Kenneth Graunke <[email protected]> | 2012-10-26 20:36:50 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-10-31 19:54:36 -0700 |
commit | 3d2b4291c2e448fd51c14fc1ff52ceaef00788cc (patch) | |
tree | 1c78b6b7123384ec6e153fe53a9baa8086cada65 /src | |
parent | 1eedebc65b02130ef7a27062a1ed67972a317a08 (diff) |
i965: Don't bother trying to extend the current vertex buffers.
This essentially reverts the following:
commit c625aa19cb53ed27f91bfd16fea6ea727e9a5bbd
Author: Chris Wilson <[email protected]>
Date: Fri Feb 18 10:37:43 2011 +0000
intel: extend current vertex buffers
While working on optimizing an upcoming Steam title, I broke this code.
Eric expressed his doubts about this optimization, and noted that the
original commit offered no performance data.
I ran before and after benchmarks on Xonotic and Citybench, and found
that this code made no difference. So, remove it to reduce complexity
and make future work simpler.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.h | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw_upload.c | 34 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vtbl.c | 1 |
3 files changed, 1 insertions, 42 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 9232a72b909..19c6af71200 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -773,16 +773,10 @@ struct brw_context struct { struct brw_vertex_element inputs[VERT_ATTRIB_MAX]; struct brw_vertex_buffer buffers[VERT_ATTRIB_MAX]; - struct { - uint32_t handle; - uint32_t offset; - uint32_t stride; - uint32_t step_rate; - } current_buffers[VERT_ATTRIB_MAX]; struct brw_vertex_element *enabled[VERT_ATTRIB_MAX]; GLuint nr_enabled; - GLuint nr_buffers, nr_current_buffers; + GLuint nr_buffers; /* Summary of size and varying of active arrays, so we can check * for changes to this state: diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 4a4237ddd5c..722166ce1a8 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -536,34 +536,6 @@ static void brw_prepare_vertices(struct brw_context *brw) upload[i]->offset = 0; } - /* can we simply extend the current vb? */ - if (j == brw->vb.nr_current_buffers) { - int delta = 0; - for (i = 0; i < j; i++) { - int d; - - if (brw->vb.current_buffers[i].handle != brw->vb.buffers[i].bo->handle || - brw->vb.current_buffers[i].stride != brw->vb.buffers[i].stride || - brw->vb.current_buffers[i].step_rate != brw->vb.buffers[i].step_rate) - break; - - d = brw->vb.buffers[i].offset - brw->vb.current_buffers[i].offset; - if (d < 0) - break; - if (i == 0) - delta = d / brw->vb.current_buffers[i].stride; - if (delta * brw->vb.current_buffers[i].stride != d) - break; - } - - if (i == j) { - brw->vb.start_vertex_bias += delta; - while (--j >= 0) - drm_intel_bo_unreference(brw->vb.buffers[j].bo); - j = 0; - } - } - brw->vb.nr_buffers = j; } @@ -644,13 +616,7 @@ static void brw_emit_vertices(struct brw_context *brw) } else OUT_BATCH(0); OUT_BATCH(buffer->step_rate); - - brw->vb.current_buffers[i].handle = buffer->bo->handle; - brw->vb.current_buffers[i].offset = buffer->offset; - brw->vb.current_buffers[i].stride = buffer->stride; - brw->vb.current_buffers[i].step_rate = buffer->step_rate; } - brw->vb.nr_current_buffers = i; ADVANCE_BATCH(); } diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index ca2e7a9a5ba..3709777a107 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -196,7 +196,6 @@ static void brw_new_batch( struct intel_context *intel ) */ brw->sol.offset_0_batch_start = brw->sol.svbi_0_starting_index; - brw->vb.nr_current_buffers = 0; brw->ib.type = -1; /* Mark that the current program cache BO has been used by the GPU. |