mesa: fix assertion in _mesa_reference_program()
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 26 Sep 2008 13:40:45 +0000 (07:40 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 26 Sep 2008 13:40:45 +0000 (07:40 -0600)
src/mesa/shader/program.c

index b3618641e50ebe745e7f39f385b300196f88b30e..738891a0293441f5636151668e74947e6171f9a8 100644 (file)
@@ -372,7 +372,11 @@ _mesa_reference_program(GLcontext *ctx,
    assert(ptr);
    if (*ptr && prog) {
       /* sanity check */
-      ASSERT((*ptr)->Target == prog->Target);
+      if ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB)
+         ASSERT(prog->Target == GL_VERTEX_PROGRAM_ARB);
+      else if ((*ptr)->Target == GL_FRAGMENT_PROGRAM_ARB)
+         ASSERT(prog->Target == GL_FRAGMENT_PROGRAM_ARB ||
+                prog->Target == GL_FRAGMENT_PROGRAM_NV);
    }
    if (*ptr == prog) {
       return;  /* no change */