From: Ian Romanick Date: Mon, 2 Nov 2009 22:10:38 +0000 (-0800) Subject: prog parse: Handle GL_VERTEX_PROGRAM_ARB in glLoadProgramNV X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2cda507fa170c040e207190dee44d1be5e8572f7;p=mesa.git prog parse: Handle GL_VERTEX_PROGRAM_ARB in glLoadProgramNV --- diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 80ed410c244..fd6cbb0f409 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -596,6 +596,12 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); + if (!ctx->Extensions.NV_vertex_program + && !ctx->Extensions.NV_fragment_program) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV()"); + return; + } + if (id == 0) { _mesa_error(ctx, GL_INVALID_VALUE, "glLoadProgramNV(id)"); return; @@ -628,7 +634,13 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, } _mesa_HashInsert(ctx->Shared->Programs, id, vprog); } - _mesa_parse_nv_vertex_program(ctx, target, program, len, vprog); + + if (ctx->Extensions.ARB_vertex_program + && (strncmp((char *) program, "!!ARB", 5) == 0)) { + _mesa_parse_arb_vertex_program(ctx, target, program, len, vprog); + } else { + _mesa_parse_nv_vertex_program(ctx, target, program, len, vprog); + } } else if (target == GL_FRAGMENT_PROGRAM_NV && ctx->Extensions.NV_fragment_program) {