summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-03-15 13:18:30 +0100
committerMichal Krol <[email protected]>2010-03-15 13:22:40 +0100
commitdbf20a1f0fa7965254aa8a0e2ea35a6b8576fd7d (patch)
treec2e58edcb76f4e4bb915cd2a257acb3600c1ad57 /src/mesa/state_tracker/st_texture.c
parent08189e639195ecb619ed37250b6dbb63017584b8 (diff)
st/mesa: Cache FBO texture's sampler view object.
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r--src/mesa/state_tracker/st_texture.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 10a38befb41..ef97d873e50 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -528,14 +528,21 @@ st_bind_teximage(struct st_framebuffer *stfb, uint surfIndex,
/* save the renderbuffer's surface/texture info */
pipe_texture_reference(&strb->texture_save, strb->texture);
pipe_surface_reference(&strb->surface_save, strb->surface);
+ pipe_sampler_view_reference(&strb->sampler_view_save, strb->sampler_view);
/* plug in new surface/texture info */
pipe_texture_reference(&strb->texture, stImage->pt);
+
+ /* XXX: Shouldn't we release reference to old surface here?
+ */
+
strb->surface = screen->get_tex_surface(screen, strb->texture,
face, level, slice,
(PIPE_BUFFER_USAGE_GPU_READ |
PIPE_BUFFER_USAGE_GPU_WRITE));
+ pipe_sampler_view_reference(&strb->sampler_view, NULL);
+
st->dirty.st |= ST_NEW_FRAMEBUFFER;
return 1;
@@ -565,9 +572,11 @@ st_release_teximage(struct st_framebuffer *stfb, uint surfIndex,
/* free tex surface, restore original */
pipe_surface_reference(&strb->surface, strb->surface_save);
pipe_texture_reference(&strb->texture, strb->texture_save);
+ pipe_sampler_view_reference(&strb->sampler_view, strb->sampler_view_save);
pipe_surface_reference(&strb->surface_save, NULL);
pipe_texture_reference(&strb->texture_save, NULL);
+ pipe_sampler_view_reference(&strb->sampler_view, NULL);
st->dirty.st |= ST_NEW_FRAMEBUFFER;