mesa: Update _Current along Current on fragment program bound.

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.
This commit is contained in:
Jerome Glisse 2007-01-15 21:19:52 +01:00
parent 7520478eb0
commit a03fc82771
1 changed files with 2 additions and 0 deletions

View 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++;