remove 'maxInst' parameter from _mesa_execute_program()
authorBrian <brian@nostromo.localnet.net>
Mon, 26 Feb 2007 01:26:50 +0000 (18:26 -0700)
committerBrian <brian@nostromo.localnet.net>
Mon, 26 Feb 2007 01:26:50 +0000 (18:26 -0700)
src/mesa/shader/prog_execute.c
src/mesa/shader/prog_execute.h
src/mesa/swrast/s_fragprog.c
src/mesa/tnl/t_vb_program.c

index 0982e3e32272c968aa0502c0c25c41f75f28e320..b3d017bd9bbd2419169f0c9bd23ea59ab091b9d8 100644 (file)
@@ -635,14 +635,14 @@ init_machine_deriv(GLcontext * ctx,
  * \param ctx - rendering context
  * \param program - the fragment program to execute
  * \param machine - machine state (register file)
- * \param maxInst - max number of instructions to execute
  * \return GL_TRUE if program completed or GL_FALSE if program executed KIL.
  */
 GLboolean
 _mesa_execute_program(GLcontext * ctx,
-                      const struct gl_program *program, GLuint maxInst,
+                      const struct gl_program *program,
                       struct gl_program_machine *machine)
 {
+   const GLuint numInst = program->NumInstructions;
    const GLuint MAX_EXEC = 10000;
    GLint pc, total = 0;
 
@@ -656,7 +656,7 @@ _mesa_execute_program(GLcontext * ctx,
    CurrentMachine = machine;
 #endif
 
-   for (pc = 0; pc < maxInst; pc++) {
+   for (pc = 0; pc < numInst; pc++) {
       const struct prog_instruction *inst = program->Instructions + pc;
 
 #if FEATURE_MESA_program_debug
index feda65fe03a14d27dda0a4b3012462858bf12c5b..2dbd922fb0f57bf710ade78484c8ab4c6bfa7e13 100644 (file)
@@ -74,7 +74,7 @@ _mesa_get_program_register(GLcontext *ctx, enum register_file file,
 
 extern GLboolean
 _mesa_execute_program(GLcontext *ctx,
-                      const struct gl_program *program, GLuint maxInst,
+                      const struct gl_program *program,
                       struct gl_program_machine *machine);
 
 
index f88714d5c7b9cca1b1b0134a8896529eb0c99175..4e1c829773fb756d54bf3bd832f2942af0ee627f 100644 (file)
@@ -147,8 +147,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end)
       if (span->array->mask[i]) {
          init_machine(ctx, &machine, program, span, i);
 
-         if (_mesa_execute_program(ctx, &program->Base,
-                                   program->Base.NumInstructions, &machine)) {
+         if (_mesa_execute_program(ctx, &program->Base, &machine)) {
             /* Store result color */
             COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i],
                     machine.Outputs[FRAG_RESULT_COLR]);
index 05b1a4aaab501bb461859fddc66c98b171f8e52c..17eefe70326e0ad9f2f20a67a0e65b5ec7f2bde3 100644 (file)
@@ -257,8 +257,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage )
       }
 
       /* execute the program */
-      _mesa_execute_program(ctx, &program->Base, program->Base.NumInstructions,
-                            &machine);
+      _mesa_execute_program(ctx, &program->Base, &machine);
 
       /* Fixup fog an point size results if needed */
       if (ctx->Fog.Enabled &&