diff options
author | Brian Paul <[email protected]> | 2003-07-22 03:34:54 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-07-22 03:34:54 +0000 |
commit | f7fda86c6dcb7894157bd35a0cf15d003d48b441 (patch) | |
tree | 3eec84c3e740c313d0dc4639bbab75435b503aba /src/mesa/main/nvvertexec.c | |
parent | 389858ee7b5207d356c9211386024af8ff9797f5 (diff) |
Implement debugger callback, etc for vertex programs. Misc clean-ups.
Diffstat (limited to 'src/mesa/main/nvvertexec.c')
-rw-r--r-- | src/mesa/main/nvvertexec.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/mesa/main/nvvertexec.c b/src/mesa/main/nvvertexec.c index b81c2278a58..06f54ca909b 100644 --- a/src/mesa/main/nvvertexec.c +++ b/src/mesa/main/nvvertexec.c @@ -332,7 +332,17 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program) struct vp_machine *machine = &ctx->VertexProgram.Machine; const struct vp_instruction *inst; + ctx->_CurrentProgram = GL_VERTEX_PROGRAM_ARB; /* or NV, doesn't matter */ + for (inst = program->Instructions; inst->Opcode != VP_OPCODE_END; inst++) { + + if (ctx->VertexProgram.CallbackEnabled && + ctx->VertexProgram.Callback) { + ctx->VertexProgram.CurrentPosition = inst->StringPos; + ctx->VertexProgram.Callback(program->Base.Target, + ctx->VertexProgram.CallbackData); + } + switch (inst->Opcode) { case VP_OPCODE_MOV: { @@ -420,10 +430,11 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program) * infinity. This may need some tweaking. */ #ifdef VMS - if (abs_t0 == __MAXFLOAT) { + if (abs_t0 == __MAXFLOAT) #else - if (IS_INF_OR_NAN(abs_t0)) { + if (IS_INF_OR_NAN(abs_t0)) #endif + { SET_POS_INFINITY(q[0]); q[1] = 1.0F; SET_POS_INFINITY(q[2]); @@ -435,7 +446,7 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program) q[1] = (GLfloat) (2.0 * mantissa); /* map [.5, 1) -> [1, 2) */ q[2] = (GLfloat) (q[0] + LOG2(q[1])); } - } + } else { SET_NEG_INFINITY(q[0]); q[1] = 1.0F; @@ -723,13 +734,17 @@ _mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program) break; case VP_OPCODE_END: + ctx->_CurrentProgram = 0; return; default: /* bad instruction opcode */ _mesa_problem(ctx, "Bad VP Opcode in _mesa_exec_vertex_program"); + ctx->_CurrentProgram = 0; return; - } - } + } /* switch */ + } /* for */ + + ctx->_CurrentProgram = 0; } |