Hi Keith,

I have reported few days ago a bug, at least what i thought to be
a bug in handling of _Current when you bind a new vertex program
(all this in shader/program.c ~line 1948). I think that whenever
_Current == Current then you should also bind new program on
_Current and not only on Current without doing that i got an app
which  segfault with r300 driver because r300 rely on the _Current
program (which no longuer exist in my test case).

I attach a patch, maybe there is better to catch this or you may
want to avoid program.c to take care of _Current.

best,
Jerome Glisse
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index ddfad47..6db62f5 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;
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to