diff options
author | Keith Whitwell <[email protected]> | 2009-06-30 16:28:37 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-06-30 16:28:54 +0100 |
commit | 4147bb24d49a10498e00039fc1dc9aa5f1316777 (patch) | |
tree | ceb027c40f52dd7e0471a3534bac7cd270b6953b /src/mesa/vbo | |
parent | 53f8dccd0c9ab0b55e24dd5d624bbaaf0c8c284b (diff) | |
parent | 6af783bea0e171582f86c8456ca521ac242abc39 (diff) |
Merge branch 'mesa_7_5_branch' into dlist-statechange-shortcircuit
Need this to pick up fixes for per-vertex materials.
Diffstat (limited to 'src/mesa/vbo')
-rw-r--r-- | src/mesa/vbo/vbo_exec_draw.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index e238d55c820..c53a4eee00c 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -268,9 +268,14 @@ static void vbo_exec_vtx_unmap( struct vbo_exec_context *exec ) void vbo_exec_vtx_map( struct vbo_exec_context *exec ) { GLcontext *ctx = exec->ctx; - GLenum target = GL_ARRAY_BUFFER_ARB; - GLenum access = GL_READ_WRITE_ARB; - GLenum usage = GL_STREAM_DRAW_ARB; + const GLenum target = GL_ARRAY_BUFFER_ARB; + const GLenum access = GL_READ_WRITE_ARB; /* for MapBuffer */ + const GLenum accessRange = GL_MAP_WRITE_BIT | /* for MapBufferRange */ + GL_MAP_INVALIDATE_RANGE_BIT | + GL_MAP_UNSYNCHRONIZED_BIT | + GL_MAP_FLUSH_EXPLICIT_BIT | + MESA_MAP_NOWAIT_BIT; + const GLenum usage = GL_STREAM_DRAW_ARB; if (exec->vtx.bufferobj->Name == 0) return; @@ -290,10 +295,7 @@ void vbo_exec_vtx_map( struct vbo_exec_context *exec ) exec->vtx.buffer_used, (VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used), - (GL_MAP_WRITE_BIT | - GL_MAP_INVALIDATE_RANGE_BIT | - GL_MAP_UNSYNCHRONIZED_BIT | - MESA_MAP_NOWAIT_BIT), + accessRange, exec->vtx.bufferobj); exec->vtx.buffer_ptr = exec->vtx.buffer_map; } @@ -305,8 +307,16 @@ void vbo_exec_vtx_map( struct vbo_exec_context *exec ) VBO_VERT_BUFFER_SIZE, NULL, usage, exec->vtx.bufferobj); - exec->vtx.buffer_map = - (GLfloat *)ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj); + + if (ctx->Driver.MapBufferRange) + exec->vtx.buffer_map = + (GLfloat *)ctx->Driver.MapBufferRange(ctx, target, + 0, VBO_VERT_BUFFER_SIZE, + accessRange, + exec->vtx.bufferobj); + else + exec->vtx.buffer_map = + (GLfloat *)ctx->Driver.MapBuffer(ctx, target, access, exec->vtx.bufferobj); exec->vtx.buffer_ptr = exec->vtx.buffer_map; } |