aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/tnl/t_draw.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-06 19:47:46 +0100
committerMarc Haesen <marc@hc-consult.be>2012-01-06 19:47:46 +0100
commit2d52fd67e716caae85bce150b01bc5c284b12de7 (patch)
tree2a641392a6affe99603cbaf169c1ab5173879d27 /mesalib/src/mesa/tnl/t_draw.c
parentd515b895dc5151d102f33b577cafbf63473bbafa (diff)
parent7e9f4ea970e8f7008c212d7d3918a974eb0066da (diff)
downloadvcxsrv-2d52fd67e716caae85bce150b01bc5c284b12de7.tar.gz
vcxsrv-2d52fd67e716caae85bce150b01bc5c284b12de7.tar.bz2
vcxsrv-2d52fd67e716caae85bce150b01bc5c284b12de7.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/glsl/link_uniforms.cpp mesalib/src/mesa/drivers/dri/common/drisw_util.c
Diffstat (limited to 'mesalib/src/mesa/tnl/t_draw.c')
-rw-r--r--mesalib/src/mesa/tnl/t_draw.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c
index 83ded1949..f949c34d3 100644
--- a/mesalib/src/mesa/tnl/t_draw.c
+++ b/mesalib/src/mesa/tnl/t_draw.c
@@ -349,26 +349,10 @@ static void bind_indices( struct gl_context *ctx,
if (_mesa_is_bufferobj(ib->obj) && !_mesa_bufferobj_mapped(ib->obj)) {
/* if the buffer object isn't mapped yet, map it now */
- unsigned map_size;
-
- switch (ib->type) {
- case GL_UNSIGNED_BYTE:
- map_size = ib->count * sizeof(GLubyte);
- break;
- case GL_UNSIGNED_SHORT:
- map_size = ib->count * sizeof(GLushort);
- break;
- case GL_UNSIGNED_INT:
- map_size = ib->count * sizeof(GLuint);
- break;
- default:
- assert(0);
- map_size = 0;
- }
-
bo[*nr_bo] = ib->obj;
(*nr_bo)++;
- ptr = ctx->Driver.MapBufferRange(ctx, (GLsizeiptr) ib->ptr, map_size,
+ ptr = ctx->Driver.MapBufferRange(ctx, (GLsizeiptr) ib->ptr,
+ ib->count * vbo_sizeof_ib_type(ib->type),
GL_MAP_READ_BIT, ib->obj);
assert(ib->obj->Pointer);
} else {