diff options
author | marha <marha@users.sourceforge.net> | 2011-02-09 08:04:41 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-02-09 08:04:41 +0000 |
commit | 744bc6a5e71f207a33b0826598c1f93302f7fe01 (patch) | |
tree | 63dcb1464076af2a0eba4f5655bfb2ebb47fe486 /mesalib/src/mesa/state_tracker/st_program.c | |
parent | 67ff1435e31fee46b1bc8d1c65da27f8ad1c39f9 (diff) | |
parent | 51a59b7f7f9b134791d3b09673063e4c45ea9eee (diff) | |
download | vcxsrv-744bc6a5e71f207a33b0826598c1f93302f7fe01.tar.gz vcxsrv-744bc6a5e71f207a33b0826598c1f93302f7fe01.tar.bz2 vcxsrv-744bc6a5e71f207a33b0826598c1f93302f7fe01.zip |
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_program.c')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_program.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c index f70e5005f..e5c26c563 100644 --- a/mesalib/src/mesa/state_tracker/st_program.c +++ b/mesalib/src/mesa/state_tracker/st_program.c @@ -108,6 +108,8 @@ delete_fp_variant(struct st_context *st, struct st_fp_variant *fpv) {
if (fpv->driver_shader)
cso_delete_fragment_shader(st->cso_context, fpv->driver_shader);
+ if (fpv->parameters)
+ _mesa_free_parameter_list(fpv->parameters);
FREE(fpv);
}
@@ -404,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;
@@ -413,17 +416,18 @@ st_translate_fragment_program(struct st_context *st, #if FEATURE_drawpix
if (key->bitmap) {
/* glBitmap drawing */
- struct gl_fragment_program *fp;
+ struct gl_fragment_program *fp; /* we free this temp program below */
st_make_bitmap_fragment_program(st, &stfp->Base,
&fp, &variant->bitmap_sampler);
variant->parameters = _mesa_clone_parameter_list(fp->Base.Parameters);
stfp = st_fragment_program(fp);
+ deleteFP = GL_TRUE;
}
else if (key->drawpixels) {
/* glDrawPixels drawing */
- struct gl_fragment_program *fp;
+ struct gl_fragment_program *fp; /* we free this temp program below */
if (key->drawpixels_z || key->drawpixels_stencil) {
fp = st_make_drawpix_z_stencil_program(st, key->drawpixels_z,
@@ -433,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);
}
@@ -630,6 +635,12 @@ st_translate_fragment_program(struct st_context *st, debug_printf("\n");
}
+ if (deleteFP) {
+ /* Free the temporary program made above */
+ struct gl_fragment_program *fp = &stfp->Base;
+ _mesa_reference_fragprog(st->ctx, &fp, NULL);
+ }
+
return variant;
}
|