diff options
author | Brian Paul <[email protected]> | 2018-01-12 09:32:41 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-01-25 12:17:26 -0700 |
commit | c860171c632a34f9c2a8ab1c06dc5a93325e84c9 (patch) | |
tree | 347feca63deba9b140a27cc598917df00a1d780d /src/mesa/state_tracker/st_context.h | |
parent | 5092610f29b9e10d3835af8b4ed1ca13809657b5 (diff) |
st/mesa: expand glDrawPixels cache to handle multiple images
The newest version of WSI Fusion makes several glDrawPixels calls
per frame. By caching more than one image, we get better performance
when panning/zooming the map.
v2: move pixel unpack param checking out of cache search loop, per Roland
v3: also move unpack->BufferObj check out of loop, per Roland.
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 */ |