aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/tnl/t_draw.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-08-31 10:31:32 +0200
committermarha <marha@users.sourceforge.net>2011-08-31 10:31:32 +0200
commitd14fe6598b87092374b1be6eb655153d270c3066 (patch)
tree77c5d19db06d8ca77ac717a5e579aa346f9cfb13 /mesalib/src/mesa/tnl/t_draw.c
parent82ce0534a7bc89f1ed93b4b952b30ceb3d94210d (diff)
downloadvcxsrv-d14fe6598b87092374b1be6eb655153d270c3066.tar.gz
vcxsrv-d14fe6598b87092374b1be6eb655153d270c3066.tar.bz2
vcxsrv-d14fe6598b87092374b1be6eb655153d270c3066.zip
mesa git update 31 aug 2011
Diffstat (limited to 'mesalib/src/mesa/tnl/t_draw.c')
-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 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) {