diff options
author | Brian Paul <[email protected]> | 2002-04-21 18:49:18 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-04-21 18:49:18 +0000 |
commit | b7752724d930aa8b93617829d814b20509f85069 (patch) | |
tree | d1583ea4033247c2facfe845efd82782206b49bc /src/mesa/main | |
parent | 1113e3266f1a9df3506fb80189bfe00d9681b55e (diff) |
vertex program attribute array work
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/dd.h | 4 | ||||
-rw-r--r-- | src/mesa/main/enable.c | 4 | ||||
-rw-r--r-- | src/mesa/main/mtypes.h | 5 | ||||
-rw-r--r-- | src/mesa/main/varray.c | 15 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 572bd054f3f..25b72245e40 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -1,4 +1,4 @@ -/* $Id: dd.h,v 1.67 2002/03/16 00:57:14 brianp Exp $ */ +/* $Id: dd.h,v 1.68 2002/04/21 18:49:18 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -542,6 +542,8 @@ struct dd_function_table { void (*TexCoordPointer)(GLcontext *ctx, GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); void (*EdgeFlagPointer)(GLcontext *ctx, GLsizei stride, const GLvoid *ptr); + void (*VertexAttribPointer)(GLcontext *ctx, GLuint index, GLint size, + GLenum type, GLsizei stride, const GLvoid *ptr); /*** State-query functions diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 78c200dcae4..af870e1639a 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1,4 +1,4 @@ -/* $Id: enable.c,v 1.61 2002/04/19 08:38:23 alanh Exp $ */ +/* $Id: enable.c,v 1.62 2002/04/21 18:49:18 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -112,7 +112,7 @@ client_state( GLcontext *ctx, GLenum cap, GLboolean state ) { GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; var = &ctx->Array.VertexAttrib[n].Enabled; - flag = _NEW_ARRAY_VERT_ATTRIB0; /* XXX flag OK? */ + flag = _NEW_ARRAY_ATTRIB(n); } break; default: diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6dde32b52c1..a14347fb553 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,4 +1,4 @@ -/* $Id: mtypes.h,v 1.71 2002/04/19 15:49:40 kschultz Exp $ */ +/* $Id: mtypes.h,v 1.72 2002/04/21 18:49:18 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1538,10 +1538,11 @@ struct matrix_stack #define _NEW_ARRAY_TEXCOORD_6 VERT_BIT_TEX6 #define _NEW_ARRAY_TEXCOORD_7 VERT_BIT_TEX7 #define _NEW_ARRAY_ALL 0xffff -#define _NEW_ARRAY_VERT_ATTRIB0 0x10000 +#define _NEW_ARRAY_ATTRIB_0 0x10000 /* start at bit 16 */ #define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i)) +#define _NEW_ARRAY_ATTRIB(i) (_NEW_ARRAY_ATTRIB_0 << (i)) /* A bunch of flags that we think might be useful to drivers. */ diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index bf783ee9707..f35e50c8724 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -1,4 +1,4 @@ -/* $Id: varray.c,v 1.42 2002/04/04 23:59:14 brianp Exp $ */ +/* $Id: varray.c,v 1.43 2002/04/21 18:49:18 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -452,12 +452,12 @@ _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *vptr) void _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, - GLsizei stride, const GLvoid *pointer) + GLsizei stride, const GLvoid *ptr) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (index >= VP_NUM_PROG_REGS) { + if (index >= VERT_ATTRIB_MAX) { _mesa_error(ctx, GL_INVALID_VALUE, "glVertexAttribPointerNV(index)"); return; } @@ -502,16 +502,13 @@ void _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, ctx->Array.VertexAttrib[index].Stride = stride; ctx->Array.VertexAttrib[index].Size = size; ctx->Array.VertexAttrib[index].Type = type; + ctx->Array.VertexAttrib[index].Ptr = (void *) ptr; - /* XXX need new flags here??? */ ctx->NewState |= _NEW_ARRAY; - /* XXX probably need new flags!!!! */ - ctx->Array.NewState |= _NEW_ARRAY_VERT_ATTRIB0; + ctx->Array.NewState |= _NEW_ARRAY_ATTRIB(index); - /* XXX - if (ctx->Driver.VertexAttribdPointer) + if (ctx->Driver.VertexAttribPointer) ctx->Driver.VertexAttribPointer( ctx, index, size, type, stride, ptr ); - */ } |