diff options
author | Christian König <[email protected]> | 2014-03-25 17:31:49 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2014-04-04 10:25:35 +0200 |
commit | 6c59be7776e4da17119a3fca21a0a568c5c11ea7 (patch) | |
tree | 0ed58e1aef79510c5ef3428f76fa7e65883c0536 /src/mesa/state_tracker/st_texture.h | |
parent | 61bedc3d6b08943f015f9d590c07a6af36c2a92c (diff) |
st/mesa: improve sampler view handling
Keep a dynamically increasing array of all the views
created for a texture instead of just the last one.
v2: add comments, fix array size calculation,
release only the first sampler view found
Signed-off-by: Christian König <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_texture.h')
-rw-r--r-- | src/mesa/state_tracker/st_texture.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h index b4a27a00a9b..87de9f9f2f4 100644 --- a/src/mesa/state_tracker/st_texture.h +++ b/src/mesa/state_tracker/st_texture.h @@ -82,10 +82,13 @@ struct st_texture_object */ struct pipe_resource *pt; - /* Default sampler view attached to this texture object. Created lazily - * on first binding. + /* Number of views in sampler_views array */ + GLuint num_sampler_views; + + /* Array of sampler views (one per context) attached to this texture + * object. Created lazily on first binding in context. */ - struct pipe_sampler_view *sampler_view; + struct pipe_sampler_view **sampler_views; /* True if this texture comes from the window system. Such a texture * cannot be reallocated and the format can only be changed with a sampler @@ -227,8 +230,15 @@ st_texture_image_copy(struct pipe_context *pipe, extern struct pipe_resource * st_create_color_map_texture(struct gl_context *ctx); +extern struct pipe_sampler_view ** +st_texture_get_sampler_view(struct st_context *st, + struct st_texture_object *stObj); + extern void st_texture_release_sampler_view(struct st_context *st, struct st_texture_object *stObj); +extern void +st_texture_release_all_sampler_views(struct st_texture_object *stObj); + #endif |