summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-02-19 08:51:51 -0700
committerBrian Paul <[email protected]>2016-02-19 08:51:51 -0700
commit44f48fead5ba62a7e5b12bbadafa2c393a5329aa (patch)
treea25d6c534337f36588fa102f99ae9043be63ea2d /src/mesa/state_tracker/st_context.c
parent71dcc067a56e76246841ae9208893db186d4b73e (diff)
st/mesa: implement a simple cache for glDrawPixels
Instead of discarding the texture we created, keep it around in case the next glDrawPixels draws the same image again. This is intended to help application which draw the same image several times in a row, either within a frame or subsequent frames. Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r--src/mesa/state_tracker/st_context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index c35055a0a97..e3ddee660f7 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -186,6 +186,10 @@ st_destroy_context_priv(struct st_context *st)
u_upload_destroy(st->constbuf_uploader);
}
+ /* free glDrawPixels cache data */
+ free(st->drawpix_cache.image);
+ pipe_resource_reference(&st->drawpix_cache.texture, NULL);
+
cso_destroy_context(st->cso_context);
free( st );
}