* rebase it into a temporary.
*/
if ((get_size(index_buffer->type) - 1) & offset) {
- GLubyte *map = ctx->Driver.MapBuffer(ctx, GL_WRITE_ONLY, bufferobj);
- map += offset;
+ GLubyte *map = ctx->Driver.MapBufferRange(ctx,
+ offset,
+ ib_size,
+ GL_MAP_WRITE_BIT,
+ bufferobj);
intel_upload_data(&brw->intel, map, ib_size, ib_type_size,
&bo, &offset);