summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_vb_program.c
diff options
context:
space:
mode:
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 fea8c11f2b..d89d006d4f 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)