summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-02-08 18:21:50 -0700
committerBrian Paul <[email protected]>2011-02-08 18:23:59 -0700
commit7230e1a22822ce91f2d2555da53404f195fa9aaf (patch)
tree48fa602cc0bba6e25247e76925727f12b8a35901 /src/mesa/state_tracker
parentf6f04ae29c25ec93ee7e28bd8525e43332262e28 (diff)
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
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_program.c7
1 files 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;
}