diff options
author | Mathias Fröhlich <[email protected]> | 2018-02-25 18:01:07 +0100 |
---|---|---|
committer | Mathias Fröhlich <[email protected]> | 2018-03-01 04:06:23 +0100 |
commit | 08aa0d9bf49ea74f84b19cd11a0f0ace7ce7211a (patch) | |
tree | 67df4045c3e6722cff79e2784b5aaa10ee3c5849 /src/mesa/vbo/vbo_save_draw.c | |
parent | f7178d677ca6a072455ff45b328b1078175a93b6 (diff) |
vbo: Implement vbo_loopback_vertex_list in terms of the VAO.
Use the information already present in the VAO to replay a display list
node using immediate mode draw commands. Use a hand full of helper methods
that will be useful for the next patches also.
v2: Insert asserts, constify local variables.
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Mathias Fröhlich <[email protected]>
Diffstat (limited to 'src/mesa/vbo/vbo_save_draw.c')
-rw-r--r-- | src/mesa/vbo/vbo_save_draw.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c index 7cb67996689..0358ecd2f90 100644 --- a/src/mesa/vbo/vbo_save_draw.c +++ b/src/mesa/vbo/vbo_save_draw.c @@ -144,26 +144,14 @@ static void loopback_vertex_list(struct gl_context *ctx, const struct vbo_save_vertex_list *list) { - const char *buffer = - ctx->Driver.MapBufferRange(ctx, 0, - list->vertex_store->bufferobj->Size, - GL_MAP_READ_BIT, /* ? */ - list->vertex_store->bufferobj, - MAP_INTERNAL); - - unsigned buffer_offset = - aligned_vertex_buffer_offset(list) ? 0 : list->buffer_offset; - - vbo_loopback_vertex_list(ctx, - (const GLfloat *) (buffer + buffer_offset), - list->attrsz, - list->prims, - list->prim_count, - list->wrap_count, - list->vertex_size); - - ctx->Driver.UnmapBuffer(ctx, list->vertex_store->bufferobj, - MAP_INTERNAL); + struct gl_buffer_object *bo = list->VAO[0]->BufferBinding[0].BufferObj; + ctx->Driver.MapBufferRange(ctx, 0, bo->Size, GL_MAP_READ_BIT, /* ? */ + bo, MAP_INTERNAL); + + /* Note that the range of referenced vertices must be mapped already */ + _vbo_loopback_vertex_list(ctx, list); + + ctx->Driver.UnmapBuffer(ctx, bo, MAP_INTERNAL); } |