summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.h
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.h
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.h')
-rw-r--r--src/mesa/state_tracker/st_context.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 1701c618ebf..f960c64cbe8 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -217,6 +217,14 @@ struct st_context
void *vert_shaders[2]; /**< ureg shaders */
} drawpix;
+ struct {
+ GLsizei width, height;
+ GLenum format, type;
+ const void *user_pointer; /**< Last user 'pixels' pointer */
+ void *image; /**< Copy of the glDrawPixels image data */
+ struct pipe_resource *texture;
+ } drawpix_cache;
+
/** for glClear */
struct {
struct pipe_rasterizer_state raster;