diff options
author | marha <marha@users.sourceforge.net> | 2011-08-29 08:51:20 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-08-29 08:51:20 +0200 |
commit | 01df5d59e56a1b060568f8cad2e89f7eea22fc70 (patch) | |
tree | 9db83037fd85d0974b60fc1a05e0665083f26000 /mesalib/src/mesa/tnl/t_draw.c | |
parent | fd1f4d9fe3ea67fa6def8ee4927a8f71e0440f12 (diff) | |
download | vcxsrv-01df5d59e56a1b060568f8cad2e89f7eea22fc70.tar.gz vcxsrv-01df5d59e56a1b060568f8cad2e89f7eea22fc70.tar.bz2 vcxsrv-01df5d59e56a1b060568f8cad2e89f7eea22fc70.zip |
xwininfo libX11 libXmu libxcb mesa xserver xkeyboard-config git update 29
aug 2011
Diffstat (limited to 'mesalib/src/mesa/tnl/t_draw.c')
-rw-r--r-- | mesalib/src/mesa/tnl/t_draw.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/mesalib/src/mesa/tnl/t_draw.c b/mesalib/src/mesa/tnl/t_draw.c index b1967e654..86af4b7cf 100644 --- a/mesalib/src/mesa/tnl/t_draw.c +++ b/mesalib/src/mesa/tnl/t_draw.c @@ -280,10 +280,9 @@ static void bind_inputs( struct gl_context *ctx, if (!inputs[i]->BufferObj->Pointer) { bo[*nr_bo] = inputs[i]->BufferObj; (*nr_bo)++; - ctx->Driver.MapBuffer(ctx, - GL_ARRAY_BUFFER, - GL_READ_ONLY_ARB, - inputs[i]->BufferObj); + ctx->Driver.MapBufferRange(ctx, 0, inputs[i]->BufferObj->Size, + GL_MAP_READ_BIT, + inputs[i]->BufferObj); assert(inputs[i]->BufferObj->Pointer); } @@ -348,18 +347,32 @@ static void bind_indices( struct gl_context *ctx, } if (ib->obj->Name && !ib->obj->Pointer) { + 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)++; - ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER, - GL_READ_ONLY_ARB, - ib->obj); - + ptr = ctx->Driver.MapBufferRange(ctx, (GLsizeiptr) ib->ptr, map_size, + GL_MAP_READ_BIT, ib->obj); assert(ib->obj->Pointer); + } else { + ptr = ib->ptr; } - ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr); - if (ib->type == GL_UNSIGNED_INT && VB->Primitive[0].basevertex == 0) { VB->Elts = (GLuint *) ptr; } @@ -402,9 +415,7 @@ static void unmap_vbos( struct gl_context *ctx, { GLuint i; for (i = 0; i < nr_bo; i++) { - ctx->Driver.UnmapBuffer(ctx, - 0, /* target -- I don't see why this would be needed */ - bo[i]); + ctx->Driver.UnmapBuffer(ctx, bo[i]); } } |