diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2003-07-22 03:34:54 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2003-07-22 03:34:54 +0000 |
commit | f7fda86c6dcb7894157bd35a0cf15d003d48b441 (patch) | |
tree | 3eec84c3e740c313d0dc4639bbab75435b503aba /src/mesa/main/arbprogram.c | |
parent | 389858ee7b5207d356c9211386024af8ff9797f5 (diff) | |
download | mesa-f7fda86c6dcb7894157bd35a0cf15d003d48b441.tar.gz |
Implement debugger callback, etc for vertex programs. Misc clean-ups.
Diffstat (limited to 'src/mesa/main/arbprogram.c')
-rw-r--r-- | src/mesa/main/arbprogram.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c index 20118d45a1f..24ab8a1035f 100644 --- a/src/mesa/main/arbprogram.c +++ b/src/mesa/main/arbprogram.c @@ -304,7 +304,9 @@ _mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!ctx->_CurrentProgram) + ASSERT_OUTSIDE_BEGIN_END(ctx); if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { @@ -477,7 +479,9 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) { struct program *prog; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!ctx->_CurrentProgram) + ASSERT_OUTSIDE_BEGIN_END(ctx); if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { @@ -682,7 +686,9 @@ _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string) { struct program *prog; GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!ctx->_CurrentProgram) + ASSERT_OUTSIDE_BEGIN_END(ctx); if (target == GL_VERTEX_PROGRAM_ARB) { prog = &(ctx->VertexProgram.Current->Base); @@ -741,7 +747,7 @@ _mesa_ProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, break; case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ if (!ctx->Extensions.ARB_vertex_program && - !ctx->Extensions.ARB_vertex_program) { + !ctx->Extensions.NV_vertex_program) { _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)"); return; } @@ -815,7 +821,10 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, GLint i; for (i = 0; i < ctx->Const.MaxVertexProgramAttribs; i++) { const char *name = _mesa_nv_vertex_input_register_name(i); - if (_mesa_strncmp(reg + 2, name, 4) == 0) { + char number[10]; + sprintf(number, "%d", i); + if (_mesa_strncmp(reg + 2, name, 4) == 0 || + _mesa_strncmp(reg + 2, number, _mesa_strlen(number)) == 0) { COPY_4V(v, ctx->VertexProgram.Machine.Registers [VP_INPUT_REG_START + i]); return; |