From 2cda507fa170c040e207190dee44d1be5e8572f7 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 2 Nov 2009 14:10:38 -0800 Subject: [PATCH] prog parse: Handle GL_VERTEX_PROGRAM_ARB in glLoadProgramNV --- src/mesa/shader/nvprogram.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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) { -- 2.30.2