i965: Only map the necessary buffer range in brw_prepare_indices
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 22 Aug 2011 17:52:47 +0000 (10:52 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 23 Aug 2011 21:52:12 +0000 (14:52 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_draw_upload.c

index ed1964f5a6fcc2a349db8d18a2926b7d36c97d4e..7bc69c612e321b89480221aced8406300b36d5f2 100644 (file)
@@ -690,11 +690,10 @@ static void brw_prepare_indices(struct brw_context *brw)
        */
        if ((get_size(index_buffer->type) - 1) & offset) {
            GLubyte *map = ctx->Driver.MapBufferRange(ctx,
-                                                    0,
-                                                    bufferobj->Size,
+                                                    offset,
+                                                    ib_size,
                                                     GL_MAP_WRITE_BIT,
                                                     bufferobj);
-           map += offset;
 
           intel_upload_data(&brw->intel, map, ib_size, ib_type_size,
                             &bo, &offset);