diff options
author | marha <marha@users.sourceforge.net> | 2010-11-22 19:42:40 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-11-22 19:42:40 +0000 |
commit | 85ef9930f56bf15181f9a0b238f03d55303cf411 (patch) | |
tree | 63b43286956ebd1c35c96e9b3d5305aabdf71a0f /mesalib/src/mesa/vbo/vbo_save_draw.c | |
parent | 94810d19989336862251dbf69c3f3acb18a9b06d (diff) | |
download | vcxsrv-85ef9930f56bf15181f9a0b238f03d55303cf411.tar.gz vcxsrv-85ef9930f56bf15181f9a0b238f03d55303cf411.tar.bz2 vcxsrv-85ef9930f56bf15181f9a0b238f03d55303cf411.zip |
Updated to mesalib 7.9
Diffstat (limited to 'mesalib/src/mesa/vbo/vbo_save_draw.c')
-rw-r--r-- | mesalib/src/mesa/vbo/vbo_save_draw.c | 71 |
1 files changed, 42 insertions, 29 deletions
diff --git a/mesalib/src/mesa/vbo/vbo_save_draw.c b/mesalib/src/mesa/vbo/vbo_save_draw.c index a7cf29acd..297fd8705 100644 --- a/mesalib/src/mesa/vbo/vbo_save_draw.c +++ b/mesalib/src/mesa/vbo/vbo_save_draw.c @@ -38,12 +38,16 @@ #include "vbo_context.h" -/* +#if FEATURE_dlist + + +/** * After playback, copy everything but the position from the * last vertex to the saved state */ -static void _playback_copy_to_current( GLcontext *ctx, - const struct vbo_save_vertex_list *node ) +static void +_playback_copy_to_current(GLcontext *ctx, + const struct vbo_save_vertex_list *node) { struct vbo_context *vbo = vbo_context(ctx); GLfloat vertex[VBO_ATTRIB_MAX * 4]; @@ -81,8 +85,7 @@ static void _playback_copy_to_current( GLcontext *ctx, node->attrsz[i], data); - if (memcmp(current, tmp, 4 * sizeof(GLfloat)) != 0) - { + if (memcmp(current, tmp, 4 * sizeof(GLfloat)) != 0) { memcpy(current, tmp, 4 * sizeof(GLfloat)); vbo->currval[i].Size = node->attrsz[i]; @@ -117,11 +120,12 @@ static void _playback_copy_to_current( GLcontext *ctx, -/* Treat the vertex storage as a VBO, define vertex arrays pointing +/** + * Treat the vertex storage as a VBO, define vertex arrays pointing * into it: */ -static void vbo_bind_vertex_list( GLcontext *ctx, - const struct vbo_save_vertex_list *node ) +static void vbo_bind_vertex_list(GLcontext *ctx, + const struct vbo_save_vertex_list *node) { struct vbo_context *vbo = vbo_context(ctx); struct vbo_save_context *save = &vbo->save; @@ -175,7 +179,7 @@ static void vbo_bind_vertex_list( GLcontext *ctx, } for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { - GLuint src = map[attr]; + const GLuint src = map[attr]; if (node_attrsz[src]) { /* override the default array set above */ @@ -203,21 +207,23 @@ static void vbo_bind_vertex_list( GLcontext *ctx, _mesa_set_varying_vp_inputs( ctx, varying_inputs ); } -static void vbo_save_loopback_vertex_list( GLcontext *ctx, - const struct vbo_save_vertex_list *list ) + +static void +vbo_save_loopback_vertex_list(GLcontext *ctx, + const struct vbo_save_vertex_list *list) { const char *buffer = ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB, GL_READ_ONLY, /* ? */ - list->vertex_store->bufferobj); + list->vertex_store->bufferobj); - vbo_loopback_vertex_list( ctx, - (const GLfloat *)(buffer + list->buffer_offset), - list->attrsz, - list->prim, - list->prim_count, - list->wrap_count, - list->vertex_size); + vbo_loopback_vertex_list(ctx, + (const GLfloat *)(buffer + list->buffer_offset), + list->attrsz, + list->prim, + list->prim_count, + list->wrap_count, + list->vertex_size); ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, list->vertex_store->bufferobj); @@ -226,10 +232,14 @@ static void vbo_save_loopback_vertex_list( GLcontext *ctx, /** * Execute the buffer and save copied verts. + * This is called from the display list code when executing + * a drawing command. */ -void vbo_save_playback_vertex_list( GLcontext *ctx, void *data ) +void +vbo_save_playback_vertex_list(GLcontext *ctx, void *data) { - const struct vbo_save_vertex_list *node = (const struct vbo_save_vertex_list *) data; + const struct vbo_save_vertex_list *node = + (const struct vbo_save_vertex_list *) data; struct vbo_save_context *save = &vbo_context(ctx)->save; FLUSH_CURRENT(ctx, 0); @@ -274,17 +284,20 @@ void vbo_save_playback_vertex_list( GLcontext *ctx, void *data ) if (ctx->NewState) _mesa_update_state( ctx ); - vbo_context(ctx)->draw_prims( ctx, - save->inputs, - node->prim, - node->prim_count, - NULL, - GL_TRUE, - 0, /* Node is a VBO, so this is ok */ - node->count - 1); + vbo_context(ctx)->draw_prims(ctx, + save->inputs, + node->prim, + node->prim_count, + NULL, + GL_TRUE, + 0, /* Node is a VBO, so this is ok */ + node->count - 1); } /* Copy to current? */ _playback_copy_to_current( ctx, node ); } + + +#endif /* FEATURE_dlist */ |