From d14fe6598b87092374b1be6eb655153d270c3066 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 31 Aug 2011 10:31:32 +0200 Subject: mesa git update 31 aug 2011 --- mesalib/src/mesa/tnl/t_draw.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mesalib/src/mesa/tnl') diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c index 86af4b7cf..03424d7a4 100644 --- a/mesalib/src/mesa/tnl/t_draw.c +++ b/mesalib/src/mesa/tnl/t_draw.c @@ -26,6 +26,7 @@ */ #include "main/glheader.h" +#include "main/bufferobj.h" #include "main/condrender.h" #include "main/context.h" #include "main/imports.h" @@ -339,14 +340,15 @@ static void bind_indices( struct gl_context *ctx, TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; GLuint i; - void *ptr; + const void *ptr; if (!ib) { VB->Elts = NULL; return; } - if (ib->obj->Name && !ib->obj->Pointer) { + 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) { @@ -370,7 +372,8 @@ static void bind_indices( struct gl_context *ctx, GL_MAP_READ_BIT, ib->obj); assert(ib->obj->Pointer); } else { - ptr = ib->ptr; + /* user-space elements, or buffer already mapped */ + ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr); } if (ib->type == GL_UNSIGNED_INT && VB->Primitive[0].basevertex == 0) { -- cgit v1.2.3