summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-11-02 13:38:15 -0800
committerIan Romanick <ian.d.romanick@intel.com>2009-11-07 15:54:32 -0800
commit289db82b2d42b0d79fd0c01781612bd4e69a9474 (patch)
tree17e85aed4016fb2b5598f3bb940f24c88e6d66cb /src
parent7452877cf64b48c58f70f73f3eda9bf2692bb9a6 (diff)
prog parse: Handle GL_FRAGMENT_PROGRAM_ARB in glLoadProgramNV
Diffstat (limited to 'src')
-rw-r--r--src/mesa/shader/nvprogram.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c
index 471a7358a2..80ed410c24 100644
--- a/src/mesa/shader/nvprogram.c
+++ b/src/mesa/shader/nvprogram.c
@@ -47,6 +47,7 @@
#include "prog_instruction.h"
#include "nvfragparse.h"
#include "nvvertparse.h"
+#include "arbprogparse.h"
#include "nvprogram.h"
@@ -643,6 +644,20 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
}
_mesa_parse_nv_fragment_program(ctx, target, program, len, fprog);
}
+ else if (target == GL_FRAGMENT_PROGRAM_ARB
+ && ctx->Extensions.ARB_fragment_program) {
+ struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog;
+ if (!fprog || prog == &_mesa_DummyProgram) {
+ fprog = (struct gl_fragment_program *)
+ ctx->Driver.NewProgram(ctx, target, id);
+ if (!fprog) {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
+ return;
+ }
+ _mesa_HashInsert(ctx->Shared->Programs, id, fprog);
+ }
+ _mesa_parse_arb_fragment_program(ctx, target, program, len, fprog);
+ }
else {
_mesa_error(ctx, GL_INVALID_ENUM, "glLoadProgramNV(target)");
}