summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_draw_upload.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_draw_upload.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw_upload.c38
1 files changed, 8 insertions, 30 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 05b6b1a50f1..baa1de353b4 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -711,7 +711,6 @@ brw_prepare_shader_draw_parameters(struct brw_context *brw)
static void
brw_upload_indices(struct brw_context *brw)
{
- struct gl_context *ctx = &brw->ctx;
const struct _mesa_index_buffer *index_buffer = brw->ib.ib;
GLuint ib_size;
struct brw_bo *old_bo = brw->ib.bo;
@@ -738,35 +737,14 @@ brw_upload_indices(struct brw_context *brw)
} else {
offset = (GLuint) (unsigned long) index_buffer->ptr;
- /* If the index buffer isn't aligned to its element size, we have to
- * rebase it into a temporary.
- */
- if ((ib_type_size - 1) & offset) {
- perf_debug("copying index buffer to a temporary to work around "
- "misaligned offset %d\n", offset);
-
- GLubyte *map = ctx->Driver.MapBufferRange(ctx,
- offset,
- ib_size,
- GL_MAP_READ_BIT,
- bufferobj,
- MAP_INTERNAL);
-
- intel_upload_data(brw, map, ib_size, ib_type_size,
- &brw->ib.bo, &offset);
- brw->ib.size = brw->ib.bo->size;
-
- ctx->Driver.UnmapBuffer(ctx, bufferobj, MAP_INTERNAL);
- } else {
- struct brw_bo *bo =
- intel_bufferobj_buffer(brw, intel_buffer_object(bufferobj),
- offset, ib_size);
- if (bo != brw->ib.bo) {
- brw_bo_unreference(brw->ib.bo);
- brw->ib.bo = bo;
- brw->ib.size = bufferobj->Size;
- brw_bo_reference(bo);
- }
+ struct brw_bo *bo =
+ intel_bufferobj_buffer(brw, intel_buffer_object(bufferobj),
+ offset, ib_size);
+ if (bo != brw->ib.bo) {
+ brw_bo_unreference(brw->ib.bo);
+ brw->ib.bo = bo;
+ brw->ib.size = bufferobj->Size;
+ brw_bo_reference(bo);
}
}