diff options
author | Brian <[email protected]> | 2007-02-22 16:06:54 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-02-22 16:06:54 -0700 |
commit | 6cfe2114f19cdcaa372df1c30a7dc7be3b94a330 (patch) | |
tree | 090d15910b45e856d854c8cb776d285d48af4965 /src/mesa/tnl/t_vb_arbprogram.c | |
parent | fd89396012bf4e2f36315e79ee180f0ca4eaf32e (diff) |
FORCE_PROG_EXECUTE_C cpp flag, misc changes
Diffstat (limited to 'src/mesa/tnl/t_vb_arbprogram.c')
-rw-r--r-- | src/mesa/tnl/t_vb_arbprogram.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c index 97ff4c7f102..1d9a6ac4603 100644 --- a/src/mesa/tnl/t_vb_arbprogram.c +++ b/src/mesa/tnl/t_vb_arbprogram.c @@ -726,8 +726,9 @@ _tnl_disassem_vba_insn( union instruction op ) } } +typedef void (*gpu_function)(struct arb_vp_machine *m, union instruction op); -static void (* const opcode_func[MAX_OPCODE+3])(struct arb_vp_machine *, union instruction) = +static gpu_function opcode_func[MAX_OPCODE+3] = { do_NOP, do_ABS, @@ -958,7 +959,10 @@ static GLuint cvp_choose_result( struct compilation *cp, idx = REG_OUT0 + dst->Index; break; default: +#if 0 + /* IF/ELSE/ENDIF instructions will hit this */ assert(0); +#endif return REG_RES; /* can't happen */ } @@ -1279,8 +1283,13 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) GLuint i, j; GLbitfield outputs; +#define FORCE_PROG_EXECUTE_C 0 +#if FORCE_PROG_EXECUTE_C + return GL_TRUE; +#else if (!program) return GL_TRUE; +#endif if (program->Base.Parameters) { _mesa_load_state_parameters(ctx, program->Base.Parameters); @@ -1338,9 +1347,9 @@ run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage) call_func( p, m ); } else { - GLint j; - for (j = 0; j < p->nr_instructions; j++) { - union instruction inst = p->instructions[j]; + GLint pc; + for (pc = 0; pc < p->nr_instructions; pc++) { + union instruction inst = p->instructions[pc]; opcode_func[inst.alu.opcode]( m, inst ); } } @@ -1468,7 +1477,11 @@ validate_vertex_program( GLcontext *ctx, struct tnl_pipeline_stage *stage ) struct arb_vp_machine *m = ARB_VP_MACHINE(stage); struct gl_vertex_program *program = ctx->VertexProgram._Current; +#if FORCE_OLD + if (0 &&program) { +#else if (program) { +#endif if (!program->TnlData) compile_vertex_program( program, m->try_codegen ); |