summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/nvvertexec.c
diff options
context:
space:
mode:
authorKarl Rasche <[email protected]>2003-11-19 13:15:13 +0000
committerKarl Rasche <[email protected]>2003-11-19 13:15:13 +0000
commit1c27a1e957546ed849b3fd0c35904e9680f113f8 (patch)
tree485cbf480ca63603e25f209f30f5fa5b8b3fc659 /src/mesa/main/nvvertexec.c
parentef563d011b5a11dc5f7a0da6445e68f14cc33062 (diff)
Initial checking of new ARB_frag/vertex program parser
Diffstat (limited to 'src/mesa/main/nvvertexec.c')
-rw-r--r--src/mesa/main/nvvertexec.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/mesa/main/nvvertexec.c b/src/mesa/main/nvvertexec.c
index 580d04abca5..f3034ea6991 100644
--- a/src/mesa/main/nvvertexec.c
+++ b/src/mesa/main/nvvertexec.c
@@ -64,6 +64,23 @@ _mesa_init_vp_registers(GLcontext *ctx)
}
/* The program parameters aren't touched */
+ /* XXX: This should be moved to glBegin() time, but its safe (and slow!)
+ * here - Karl
+ */
+ if (ctx->VertexProgram.Current->Parameters) {
+
+ /* Grab the state */
+ _mesa_load_state_parameters(ctx, ctx->VertexProgram.Current->Parameters);
+
+ /* And copy it into the program state */
+ for (i=0; i<ctx->VertexProgram.Current->Parameters->NumParameters; i++) {
+ MEMCPY(ctx->VertexProgram.Parameters[i],
+ &ctx->VertexProgram.Current->Parameters->Parameters[i].Values,
+ 4*sizeof(GLfloat));
+ }
+
+ }
+
}
@@ -234,13 +251,11 @@ get_register_pointer( const struct vp_src_register *source,
return state->Inputs[source->Index];
case PROGRAM_LOCAL_PARAM:
/* XXX fix */
- return state->Temporaries[source->Index];
+ return state->Temporaries[source->Index];
case PROGRAM_ENV_PARAM:
return state->Parameters[source->Index];
case PROGRAM_STATE_VAR:
- /* XXX fix */
- return NULL;
- break;
+ return state->Parameters[source->Index];
default:
_mesa_problem(NULL,
"Bad source register file in fetch_vector4(vp)");