From 7230e1a22822ce91f2d2555da53404f195fa9aaf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 8 Feb 2011 18:21:50 -0700 Subject: [PATCH] st/mesa: fix shader deletion regression Fixes a regression from commit 5cbff0932e498f49b57cbb71037b93416bfe30e0. The problem is *some* glDrawPixels fragment programs need to be deleted, but not all. Use an explicit flag to indicate whether or not the program needs to be deleted. This should fix http://bugs.freedesktop.org/show_bug.cgi?id=34049 --- src/mesa/state_tracker/st_program.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 174b146ab73..fc1dfb3ef9e 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -406,6 +406,7 @@ st_translate_fragment_program(struct st_context *st, { struct pipe_context *pipe = st->pipe; struct st_fp_variant *variant = CALLOC_STRUCT(st_fp_variant); + GLboolean deleteFP = GL_FALSE; if (!variant) return NULL; @@ -422,6 +423,7 @@ st_translate_fragment_program(struct st_context *st, variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters); stfp = st_fragment_program(fp); + deleteFP = GL_TRUE; } else if (key->drawpixels) { /* glDrawPixels drawing */ @@ -435,6 +437,7 @@ st_translate_fragment_program(struct st_context *st, /* RGBA */ st_make_drawpix_fragment_program(st, &stfp->Base, &fp); variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters); + deleteFP = GL_TRUE; } stfp = st_fragment_program(fp); } @@ -632,13 +635,11 @@ st_translate_fragment_program(struct st_context *st, debug_printf("\n"); } -#if FEATURE_drawpix - if (key->bitmap || key->drawpixels) { + if (deleteFP) { /* Free the temporary program made above */ struct gl_fragment_program *fp = &stfp->Base; _mesa_reference_fragprog(st->ctx, &fp, NULL); } -#endif return variant; } -- 2.30.2