diff options
Diffstat (limited to 'src/mesa/state_tracker/st_context.h')
-rw-r--r-- | src/mesa/state_tracker/st_context.h | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 0258bed36b1..ae2bdf596ac 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -86,6 +86,20 @@ struct st_bound_handles uint64_t *handles; }; + +#define NUM_DRAWPIX_CACHE_ENTRIES 4 + +struct drawpix_cache_entry +{ + 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; + unsigned age; +}; + + struct st_context { struct st_context_iface iface; @@ -208,12 +222,10 @@ struct st_context void *vert_shaders[2]; /**< ureg shaders */ } drawpix; + /** Cache of glDrawPixels images */ 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; + struct drawpix_cache_entry entries[NUM_DRAWPIX_CACHE_ENTRIES]; + unsigned age; } drawpix_cache; /** for glReadPixels */ |