diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2009-11-02 13:37:47 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2009-11-07 15:54:32 -0800 |
commit | 7452877cf64b48c58f70f73f3eda9bf2692bb9a6 (patch) | |
tree | de2c841c4efaa07e1d2dca11d3d7545dfa12d5a8 /src/mesa | |
parent | 26d2ce0a09f1aac628519cf3473fcabd3f149446 (diff) | |
download | external_mesa3d-7452877cf64b48c58f70f73f3eda9bf2692bb9a6.zip external_mesa3d-7452877cf64b48c58f70f73f3eda9bf2692bb9a6.tar.gz external_mesa3d-7452877cf64b48c58f70f73f3eda9bf2692bb9a6.tar.bz2 |
prog parse: Handle GL_FRAGMENT_PROGRAM_NV in glProgramStringARB
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/shader/arbprogram.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 4d8cff0..ca71a39 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -37,6 +37,7 @@ #include "main/mtypes.h" #include "arbprogram.h" #include "arbprogparse.h" +#include "nvfragparse.h" #include "program.h" @@ -428,6 +429,7 @@ void GLAPIENTRY _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid *string) { + struct gl_program *base; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -442,22 +444,30 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, && ctx->Extensions.ARB_vertex_program) { struct gl_vertex_program *prog = ctx->VertexProgram.Current; _mesa_parse_arb_vertex_program(ctx, target, string, len, prog); - - if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base ); + + base = & prog->Base; } else if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { struct gl_fragment_program *prog = ctx->FragmentProgram.Current; _mesa_parse_arb_fragment_program(ctx, target, string, len, prog); - if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base ); + base = & prog->Base; + } + else if (target == GL_FRAGMENT_PROGRAM_NV + && ctx->Extensions.NV_fragment_program) { + struct gl_fragment_program *prog = ctx->FragmentProgram.Current; + _mesa_parse_nv_fragment_program(ctx, target, string, len, prog); + + base = & prog->Base; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(target)"); return; } + + if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify) + ctx->Driver.ProgramStringNotify( ctx, target, base ); } |