summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_vb_program.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-04-21 20:37:04 +0000
committerBrian Paul <[email protected]>2002-04-21 20:37:04 +0000
commit12bab63f09975504c20a5dc9b9831a8072c43506 (patch)
treee1bb3a48e6a65cf6c563444ad12da5317b79d90b /src/mesa/tnl/t_vb_program.c
parentf3781eaafa54d1e4fef0de427b294c02257a3c4d (diff)
Vertex program attribute arrays seem to work now. This includes fallbacks
to the conventional arrays when attribute arrays aren't enabled.
Diffstat (limited to 'src/mesa/tnl/t_vb_program.c')
-rw-r--r--src/mesa/tnl/t_vb_program.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c
index fea8c11f2b7..d89d006d4f6 100644
--- a/src/mesa/tnl/t_vb_program.c
+++ b/src/mesa/tnl/t_vb_program.c
@@ -1,4 +1,4 @@
-/* $Id: t_vb_program.c,v 1.11 2002/04/04 18:25:40 kschultz Exp $ */
+/* $Id: t_vb_program.c,v 1.12 2002/04/21 20:37:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -182,10 +182,6 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
VB->AttribPtr[2]->data[i][3]);
#endif
- /* XXXX
- * We have to deal with stride!=16 bytes, size!=4, etc in these loops!!!
- */
-
/* load the input attribute registers */
if (VB->Flag) {
/* the traditional glBegin/glVertex/glEnd case */
@@ -199,13 +195,14 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
else {
/* the vertex array case */
for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) {
- const GLubyte *ptr = (const GLubyte *) VB->AttribPtr[attr]->data;
- const GLint stride = VB->AttribPtr[attr]->stride;
- const GLfloat *data = (GLfloat *) (ptr + stride * i);
- const GLint size = VB->AttribPtr[attr]->size;
- COPY_4V(machine->Registers[VP_INPUT_REG_START + attr], data);
- if (size == 3)
- machine->Registers[VP_INPUT_REG_START + attr][3] = 1.0;
+ if (program->InputsRead & (1 << attr)) {
+ const GLubyte *ptr = (const GLubyte*) VB->AttribPtr[attr]->data;
+ const GLuint stride = VB->AttribPtr[attr]->stride;
+ const GLfloat *data = (GLfloat *) (ptr + stride * i);
+ COPY_4V(machine->Registers[VP_INPUT_REG_START + attr], data);
+ /*ASSERT(VB->AttribPtr[attr]->size == 4);*/
+ ASSERT(stride == 4 * sizeof(GLfloat) || stride == 0);
+ }
}
}
@@ -406,10 +403,12 @@ static void check_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
stage->active = ctx->VertexProgram.Enabled;
if (stage->active) {
- /* XXX what do we need here??? */
- /*
- GLbitfield vpInput = ctx->VertexProgram.Current->InputsRead;
- */
+ /* XXX what do we need here???
+ *
+ * I think that:
+ * stage->inputs = ctx->VertexProgram.Current->InputsRead;
+ * would be correct, and something similar for the outputs.
+ */
#if 000
if (stage->privatePtr)