aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/tnl
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-08-31 11:39:10 +0200
committermarha <marha@users.sourceforge.net>2011-08-31 11:39:10 +0200
commitbdc38022df44bde91e7ff95f6446cf20e19eaa5f (patch)
tree63386f21679537a891a7cc44fb7dc15ad57cf1df /mesalib/src/mesa/tnl
parenta15173d276fcc8bb45637bba9f027136f4915652 (diff)
parentd14fe6598b87092374b1be6eb655153d270c3066 (diff)
downloadvcxsrv-bdc38022df44bde91e7ff95f6446cf20e19eaa5f.tar.gz
vcxsrv-bdc38022df44bde91e7ff95f6446cf20e19eaa5f.tar.bz2
vcxsrv-bdc38022df44bde91e7ff95f6446cf20e19eaa5f.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/docs/README.WIN32 mesalib/docs/install.html mesalib/src/glu/sgi/include/gluos.h mesalib/src/mesa/drivers/windows/gdi/wgl.c mesalib/src/mesa/main/state.c mesalib/src/mesa/main/uniforms.c mesalib/src/mesa/tnl/t_draw.c
Diffstat (limited to 'mesalib/src/mesa/tnl')
-rw-r--r--mesalib/src/mesa/tnl/t_draw.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c
index f3f324314..03d343319 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) {