summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r--src/mesa/state_tracker/st_texture.c93
1 files changed, 0 insertions, 93 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 32e5b84..a2c36ac 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -418,96 +418,3 @@ st_create_color_map_texture(struct gl_context *ctx)
texSize, texSize, 1, 1, 0, PIPE_BIND_SAMPLER_VIEW);
return pt;
}
-
-/**
- * Try to find a matching sampler view for the given context.
- * If none is found an empty slot is initialized with a
- * template and returned instead.
- */
-struct pipe_sampler_view **
-st_texture_get_sampler_view(struct st_context *st,
- struct st_texture_object *stObj)
-{
- struct pipe_sampler_view **free = NULL;
- GLuint i;
-
- for (i = 0; i < stObj->num_sampler_views; ++i) {
- struct pipe_sampler_view **sv = &stObj->sampler_views[i];
- /* Is the array entry used ? */
- if (*sv) {
- /* check if the context matches */
- if ((*sv)->context == st->pipe) {
- return sv;
- }
- } else {
- /* Found a free slot, remember that */
- free = sv;
- }
- }
-
- /* Couldn't find a slot for our context, create a new one */
-
- if (!free) {
- /* Haven't even found a free one, resize the array */
- GLuint old_size = stObj->num_sampler_views * sizeof(void *);
- GLuint new_size = old_size + sizeof(void *);
- stObj->sampler_views = REALLOC(stObj->sampler_views, old_size, new_size);
- free = &stObj->sampler_views[stObj->num_sampler_views++];
- *free = NULL;
- }
-
- assert(*free == NULL);
-
- return free;
-}
-
-
-/**
- * For the given texture object, release any sampler views which belong
- * to the calling context.
- */
-void
-st_texture_release_sampler_view(struct st_context *st,
- struct st_texture_object *stObj)
-{
- GLuint i;
-
- for (i = 0; i < stObj->num_sampler_views; ++i) {
- struct pipe_sampler_view **sv = &stObj->sampler_views[i];
-
- if (*sv && (*sv)->context == st->pipe) {
- pipe_sampler_view_reference(sv, NULL);
- break;
- }
- }
-}
-
-
-/**
- * Release all sampler views attached to the given texture object, regardless
- * of the context.
- */
-void
-st_texture_release_all_sampler_views(struct st_context *st,
- struct st_texture_object *stObj)
-{
- GLuint i;
-
- /* XXX This should use sampler_views[i]->pipe, not st->pipe */
- for (i = 0; i < stObj->num_sampler_views; ++i)
- pipe_sampler_view_release(st->pipe, &stObj->sampler_views[i]);
-}
-
-
-void
-st_texture_free_sampler_views(struct st_texture_object *stObj)
-{
- /* NOTE:
- * We use FREE() here to match REALLOC() above. Both come from
- * u_memory.h, not imports.h. If we mis-match MALLOC/FREE from
- * those two headers we can trash the heap.
- */
- FREE(stObj->sampler_views);
- stObj->sampler_views = NULL;
- stObj->num_sampler_views = 0;
-}