meta: Don't hang on to program refcounts after metaops are done.
authorEric Anholt <eric@anholt.net>
Tue, 20 Sep 2011 23:23:57 +0000 (16:23 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 21 Sep 2011 17:17:54 +0000 (10:17 -0700)
Fixes piglit ARB_shader_objects/clear-with-deleted.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39577
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/common/meta.c

index 9703475d031b6de145c0f1a8e3e1bbff3cbcd34d..b6e80d70ab9c7f3053741c0e0e8c1b2eccaa199c 100644 (file)
@@ -740,6 +740,11 @@ _mesa_meta_end(struct gl_context *ctx)
 
       _mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram,
                                     save->ActiveShader);
+
+      _mesa_reference_shader_program(ctx, &save->VertexShader, NULL);
+      _mesa_reference_shader_program(ctx, &save->GeometryShader, NULL);
+      _mesa_reference_shader_program(ctx, &save->FragmentShader, NULL);
+      _mesa_reference_shader_program(ctx, &save->ActiveShader, NULL);
    }
 
    if (state & MESA_META_STENCIL_TEST) {