From 75b5cb43173cda966682c8c9b9353c48ab6ad285 Mon Sep 17 00:00:00 2001 From: Karl Rasche Date: Wed, 19 Nov 2003 13:17:33 +0000 Subject: Initial checkin of new ARB_frag/vertex program parser --- src/mesa/swrast/s_nvfragprog.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 332edc5c86..94458238b5 100644 --- a/src/mesa/swrast/s_nvfragprog.c +++ b/src/mesa/swrast/s_nvfragprog.c @@ -38,7 +38,6 @@ /* if 1, print some debugging info */ #define DEBUG_FRAG 0 - /** * Fetch a texel. */ @@ -120,13 +119,14 @@ get_register_pointer( GLcontext *ctx, ASSERT(source->Index < MAX_NV_FRAGMENT_PROGRAM_PARAMS); src = ctx->FragmentProgram.Parameters[source->Index]; break; + + case PROGRAM_STATE_VAR: + /* Fallthrough */ + case PROGRAM_NAMED_PARAM: ASSERT(source->Index < (GLint) program->Parameters->NumParameters); src = program->Parameters->Parameters[source->Index].Values; break; - case PROGRAM_STATE_VAR: - src = NULL; - break; default: _mesa_problem(ctx, "Invalid input register file in fetch_vector4"); src = NULL; @@ -572,6 +572,12 @@ execute_program( GLcontext *ctx, printf("execute fragment program --------------------\n"); #endif + /* XXX: This should go someplace else, but it is safe here (and slow!) + * - karl + */ + _mesa_load_state_parameters(ctx, program->Parameters); + + for (pc = 0; pc < maxInst; pc++) { const struct fp_instruction *inst = program->Instructions + pc; -- cgit v1.2.3