diff options
author | Jerome Glisse <[email protected]> | 2007-01-14 14:49:36 +0100 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2007-01-14 14:49:36 +0100 |
commit | 6dd967e74ff4cb03220d5785bd583203464d299d (patch) | |
tree | 614dd40f8b027bdfaa61c26bd5a7f6ae4a1de13e | |
parent | e7112be7321c58e6039fde28f47ffe3dce5cc205 (diff) |
mesa: Update _Current ptr along Current when a new vertex program is bind.
On new vertex program bind only the Current ptr where updated to
point to the new program; this could lead to _Current pointing to
and out of date or even a no more existing program which in turn
could lead to a segfault in some driver. To avoid this _Current
ptr is updated along Current if _Current where previously pointing
to the same program.
-rw-r--r-- | src/mesa/shader/program.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index ddfad47b894..6db62f591c8 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -1947,6 +1947,8 @@ _mesa_BindProgram(GLenum target, GLuint id) /* bind newProg */ if (target == GL_VERTEX_PROGRAM_ARB) { /* == GL_VERTEX_PROGRAM_NV */ + if (ctx->VertexProgram._Current == ctx->VertexProgram.Current) + ctx->VertexProgram._Current = (struct gl_vertex_program *) newProg; ctx->VertexProgram.Current = (struct gl_vertex_program *) newProg; } else if (target == GL_FRAGMENT_PROGRAM_NV || @@ -1969,7 +1971,7 @@ _mesa_BindProgram(GLenum target, GLuint id) * \note Not compiled into display lists. * \note Called by both glDeleteProgramsNV and glDeleteProgramsARB. */ -void GLAPIENTRY +void GLAPIENTRY _mesa_DeletePrograms(GLsizei n, const GLuint *ids) { GLint i; |