summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_save_draw.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2006-10-30 16:44:13 +0000
committerKeith Whitwell <[email protected]>2006-10-30 16:44:13 +0000
commit99efde461d3b8615863bdb7308e05289e0db0422 (patch)
tree95b9e3f4f612957a93547892f3559cfaa44dccb7 /src/mesa/vbo/vbo_save_draw.c
parentefef291dc71eb57f90785a26957f4b3e01733156 (diff)
better handling of current attributes. Trivial dlist and varray tests work
Diffstat (limited to 'src/mesa/vbo/vbo_save_draw.c')
-rw-r--r--src/mesa/vbo/vbo_save_draw.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index 44e01712330..18c770a41cb 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -95,14 +95,36 @@ static void _playback_copy_to_current( GLcontext *ctx,
/* Treat the vertex storage as a VBO, define vertex arrays pointing
* into it:
*/
-static void vbo_bind_vertex_list( struct vbo_save_context *save,
+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;
struct gl_client_array *arrays = save->arrays;
GLuint data = node->buffer_offset;
+ const GLuint *map;
GLuint attr;
- memset(arrays, 0, VBO_ATTRIB_MAX * sizeof(arrays[0]));
+ /* Install the default (ie Current) attributes first, then overlay
+ * all active ones.
+ */
+ switch (get_program_mode(ctx)) {
+ case VP_NONE:
+ memcpy(arrays, vbo->legacy_currval, 16 * sizeof(arrays[0]));
+ memcpy(arrays + 16, vbo->mat_currval, 16 * sizeof(arrays[0]));
+ map = vbo->map_vp_none;
+ break;
+ case VP_NV:
+ case VP_ARB:
+ /* The aliasing of attributes for NV vertex programs has already
+ * occurred. NV vertex programs cannot access material values,
+ * nor attributes greater than VERT_ATTRIB_TEX7.
+ */
+ memcpy(arrays, vbo->legacy_currval, 16 * sizeof(arrays[0]));
+ memcpy(arrays + 16, vbo->generic_currval, 16 * sizeof(arrays[0]));
+ map = vbo->map_vp_arb;
+ break;
+ }
for (attr = 0; attr <= VBO_ATTRIB_INDEX; attr++) {
if (node->attrsz[attr]) {
@@ -185,7 +207,7 @@ void vbo_save_playback_vertex_list( GLcontext *ctx, void *data )
return;
}
- vbo_bind_vertex_list( save, node );
+ vbo_bind_vertex_list( ctx, node );
vbo_context(ctx)->draw_prims( ctx,
save->inputs,