mesa: Update _Current along Current on fragment program bound.
authorJerome Glisse <glisse@freedesktop.org>
Mon, 15 Jan 2007 20:19:52 +0000 (21:19 +0100)
committerJerome Glisse <glisse@freedesktop.org>
Mon, 15 Jan 2007 20:21:10 +0000 (21:21 +0100)
Same as a previously committed patch for vertex program, we
update fragment program ptr _Current along the Current one
so that _Current can't end up pointing to a no more valid
program.

src/mesa/shader/program.c

index 6db62f591c8b56130861af8896c20473d00ca62f..8442ba3248c3906aefc6dc971bc4bf414f1bbeed 100644 (file)
@@ -1953,6 +1953,8 @@ _mesa_BindProgram(GLenum target, GLuint id)
    }
    else if (target == GL_FRAGMENT_PROGRAM_NV ||
             target == GL_FRAGMENT_PROGRAM_ARB) {
+      if (ctx->FragmentProgram._Current == ctx->FragmentProgram.Current)
+         ctx->FragmentProgram._Current = (struct gl_fragment_program *) newProg;
       ctx->FragmentProgram.Current = (struct gl_fragment_program *) newProg;
    }
    newProg->RefCount++;