diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-01-16 09:47:35 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-01-16 09:47:35 +0000 |
commit | 0b412f8f156b46b0e7220a2b61e0f41781769f66 (patch) | |
tree | e8c2b71dd2dfa3687ec72b9767e6a82826a90979 /src/mesa/vbo/vbo_context.c | |
parent | 5363e3331ba016c9b1b9d5167473d69f32be3dac (diff) | |
parent | 584def75ad8dd13add5b4ed7e364d13202539539 (diff) |
Merge branch 'vbo_0_1_branch' into vbo-0.2
Diffstat (limited to 'src/mesa/vbo/vbo_context.c')
-rw-r--r-- | src/mesa/vbo/vbo_context.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c index 165e32da8a..65998e7ff7 100644 --- a/src/mesa/vbo/vbo_context.c +++ b/src/mesa/vbo/vbo_context.c @@ -47,6 +47,14 @@ extern void _tnl_draw_prims( GLcontext *ctx, #define NR_GENERIC_ATTRIBS 16 #define NR_MAT_ATTRIBS 12 +static GLuint check_size( const GLfloat *attr ) +{ + if (attr[3] != 1.0) return 4; + if (attr[2] != 0.0) return 3; + if (attr[1] != 0.0) return 2; + return 1; +} + static void init_legacy_currval(GLcontext *ctx) { struct vbo_context *vbo = vbo_context(ctx); @@ -63,7 +71,7 @@ static void init_legacy_currval(GLcontext *ctx) /* Size will have to be determined at runtime: */ - cl->Size = 1; + cl->Size = check_size(ctx->Current.Attrib[i]); cl->Stride = 0; cl->StrideB = 0; cl->Enabled = 1; @@ -88,7 +96,6 @@ static void init_generic_currval(GLcontext *ctx) /* This will have to be determined at runtime: */ cl->Size = 1; - cl->Type = GL_FLOAT; cl->Ptr = (const void *)ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + i]; cl->Stride = 0; |