the get_register_pointer() function was pretty well broken in a few ways

This commit is contained in:
Brian Paul 2004-06-29 00:03:59 +00:00
parent ac33dd1312
commit 80cc018a68
1 changed files with 9 additions and 16 deletions

View File

@ -163,19 +163,9 @@ _mesa_init_vp_per_primitive_registers(GLcontext *ctx)
else {
/* Using and ARB vertex program */
if (ctx->VertexProgram.Current->Parameters) {
GLuint i;
/* Grab the state */
/* Grab the state GL state and put into registers */
_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));
}
}
}
}
@ -252,19 +242,23 @@ get_register_pointer( const struct vp_src_register *source,
else {
switch (source->File) {
case PROGRAM_TEMPORARY:
ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_TEMPS);
return state->Temporaries[source->Index];
case PROGRAM_INPUT:
ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_INPUTS);
return state->Inputs[source->Index];
case PROGRAM_LOCAL_PARAM:
/* XXX fix */
return state->Temporaries[source->Index];
ASSERT(source->Index < MAX_PROGRAM_LOCAL_PARAMS);
return state->Current->Base.LocalParams[source->Index];
case PROGRAM_ENV_PARAM:
ASSERT(source->Index < MAX_NV_VERTEX_PROGRAM_PARAMS);
return state->Parameters[source->Index];
case PROGRAM_STATE_VAR:
return state->Parameters[source->Index];
ASSERT(source->Index < state->Current->Parameters->NumParameters);
return state->Current->Parameters->Parameters[source->Index].Values;
default:
_mesa_problem(NULL,
"Bad source register file in fetch_vector4(vp)");
"Bad source register file in get_register_pointer");
return NULL;
}
}
@ -397,7 +391,6 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program)
/* XXX: This could go elsewhere */
ctx->VertexProgram.Current->OutputsWritten |= 0x1;
}
for (inst = program->Instructions; ; inst++) {
if (ctx->VertexProgram.CallbackEnabled &&