aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/vbo/vbo_save_draw.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-11-29 22:05:53 +0000
committermarha <marha@users.sourceforge.net>2010-11-29 22:05:53 +0000
commitfed109d6a33c0871291d1bb2f3f6b7a3d1a3e9d7 (patch)
treefa1ba494685a71e28a096990a8707680c7cb378b /mesalib/src/mesa/vbo/vbo_save_draw.c
parentae340911c1ba1f98b418bd8f1a487fa4d79491b0 (diff)
parent6fda93be42ace9eeab0e82ceebb6798961c9105c (diff)
downloadvcxsrv-fed109d6a33c0871291d1bb2f3f6b7a3d1a3e9d7.tar.gz
vcxsrv-fed109d6a33c0871291d1bb2f3f6b7a3d1a3e9d7.tar.bz2
vcxsrv-fed109d6a33c0871291d1bb2f3f6b7a3d1a3e9d7.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/vbo/vbo_save_draw.c')
-rw-r--r--mesalib/src/mesa/vbo/vbo_save_draw.c71
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 */