summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-11-02 14:10:38 -0800
committerIan Romanick <ian.d.romanick@intel.com>2009-11-07 15:54:33 -0800
commit2cda507fa170c040e207190dee44d1be5e8572f7 (patch)
tree34ab42239c05b167aab86fa807639c7ab8defd4a
parent6d2ceda780967848b6147061287095c35bc9d92f (diff)
prog parse: Handle GL_VERTEX_PROGRAM_ARB in glLoadProgramNV
-rw-r--r--src/mesa/shader/nvprogram.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c
index 80ed410c24..fd6cbb0f40 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) {