[965] Force a new vertex upload buffer at new batch time.
authorEric Anholt <eric@anholt.net>
Sat, 12 Jan 2008 00:00:50 +0000 (16:00 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 14 Jan 2008 18:18:38 +0000 (10:18 -0800)
Otherwise, we could choose to upload into the temporary VBO that we just fired
off to the hardware.  Good for a 60% OA performance improvement.

src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/i965/brw_vtbl.c

index c74aff785ea23a32d1fafd1d1e5519c6dc5e20e1..63547f386d36bd978dc57e7cc06e714e032583df 100644 (file)
@@ -325,7 +325,7 @@ static GLboolean brw_try_draw_prims( GLcontext *ctx,
 
    brw->no_batch_wrap = GL_FALSE;
 
-   /* Free any old data so it doesn't clog up texture memory - we
+   /* Free any completed data so it doesn't clog up texture memory - we
     * won't be referencing it again.
     */
    while (brw->vb.upload.wrap != brw->vb.upload.buf) {
index 126e655839553941ecd130328d70ca0d89b44764..0b70888071d4699ac7dd6a937d435d75d01cf98d 100644 (file)
@@ -106,6 +106,11 @@ static void brw_new_batch( struct intel_context *intel )
    brw->state.dirty.mesa |= ~0;
    brw->state.dirty.brw |= ~0;
    brw->state.dirty.cache |= ~0;
+
+   /* Move to the end of the current upload buffer so that we'll force choosing
+    * a new buffer next time.
+    */
+   brw->vb.upload.offset = brw->vb.upload.vbo[brw->vb.upload.buf]->Size;
 }
 
 static void brw_note_fence( struct intel_context *intel,