summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_vb_program.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-12-18 04:06:44 +0000
committerBrian Paul <[email protected]>2001-12-18 04:06:44 +0000
commit30f51ae067379c2b3573c06b707d25a9704df7be (patch)
tree401d75d291724d0d3a47be29d4d3512dcdb66a5a /src/mesa/tnl/t_vb_program.c
parent645ced29552da1af5c759d0497d98c8f55b72935 (diff)
Replace old matrix stacks with new code based on struct matrix_stack.
Moved vertex program hash table into shared context state. Implemented reference counting for vertex programs. Replaced tnl "ProjectedClip" with "Ndc" (normalized device coordinates).
Diffstat (limited to 'src/mesa/tnl/t_vb_program.c')
-rw-r--r--src/mesa/tnl/t_vb_program.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c
index b713031decb..aea3c868aca 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.4 2001/12/15 22:31:23 brianp Exp $ */
+/* $Id: t_vb_program.c,v 1.5 2001/12/18 04:06:46 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -718,7 +718,6 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
struct vp_stage_data *store = VP_STAGE_DATA(stage);
struct vertex_buffer *VB = &tnl->vb;
struct vp_machine *machine = &(ctx->VertexProgram.Machine);
- struct vp_program *program;
GLint i;
/* convenience pointers */
@@ -734,9 +733,6 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
GLfloat (*texture2)[4] = (GLfloat (*)[4]) store->texCoord[2].data;
GLfloat (*texture3)[4] = (GLfloat (*)[4]) store->texCoord[3].data;
- program = (struct vp_program *) _mesa_HashLookup(ctx->VertexProgram.HashTable, ctx->VertexProgram.Binding);
- assert(program);
-
_mesa_init_tracked_matrices(ctx);
_mesa_init_vp_registers(ctx); /* sets temp regs to (0,0,0,1) */
@@ -770,7 +766,8 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
}
/* execute the program */
- _mesa_exec_program(ctx, program);
+ ASSERT(ctx->VertexProgram.Current);
+ _mesa_exec_program(ctx, ctx->VertexProgram.Current);
#if 0
printf("Output %d: %f, %f, %f, %f\n", i,
@@ -819,8 +816,8 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
store->ormask = 0;
store->andmask = CLIP_ALL_BITS;
- if (tnl->NeedProjCoords) {
- VB->ProjectedClipPtr =
+ if (tnl->NeedNdcCoords) {
+ VB->NdcPtr =
_mesa_clip_tab[VB->ClipPtr->size]( VB->ClipPtr,
&store->ndcCoords,
store->clipmask,
@@ -829,7 +826,7 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
}
else {
- VB->ProjectedClipPtr = 0;
+ VB->NdcPtr = 0;
_mesa_clip_np_tab[VB->ClipPtr->size]( VB->ClipPtr,
0,
store->clipmask,