[Mesa-dev] [PATCH 13/12] i965: Only map the necessary buffer range in brw_prepare_indices

Ian Romanick idr at freedesktop.org
Mon Aug 22 10:54:45 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

---
 src/mesa/drivers/dri/i965/brw_draw_upload.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index ed1964f..7bc69c6 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -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);
-- 
1.7.4.4



More information about the mesa-dev mailing list