i965: update RefCount when using Vertex/Fragment program.
authorXiang, Haihao <haihao.xiang@intel.com>
Wed, 28 Nov 2007 01:46:43 +0000 (09:46 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 28 Nov 2007 01:46:43 +0000 (09:46 +0800)
It makes quake4-demo works well on 965.

src/mesa/drivers/dri/i965/brw_context.c

index bdfdfd17043cbfb3298f5f9227d276350775d5d5..4654ab1ddfecbf0bda78abc6b6748f7a637e4c65 100644 (file)
@@ -70,12 +70,14 @@ static void brwUseProgram(GLcontext *ctx, GLuint program)
         if (sh_prog) {
            if (sh_prog->VertexProgram) {
                brw->attribs.VertexProgram->Current = sh_prog->VertexProgram;
+               sh_prog->VertexProgram->Base.RefCount++;
                ctx->VertexProgram.Enabled = GL_TRUE;
            }else
                ctx->VertexProgram.Enabled = GL_FALSE;
                
            if (sh_prog->FragmentProgram) {
                brw->attribs.FragmentProgram->Current = sh_prog->FragmentProgram;
+               sh_prog->FragmentProgram->Base.RefCount++;
                ctx->FragmentProgram.Enabled = GL_TRUE;
            } else
                ctx->FragmentProgram.Enabled = GL_FALSE;