diff options
author | Zack Rusin <zackr@vmware.com> | 2010-03-30 21:10:33 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2010-03-30 21:10:33 -0400 |
commit | 880e3fb09b538f6f0b6fad2db7e0e10e9df43555 (patch) | |
tree | e6cc8c691974e679ead73c3731c49a874019c8ba /src/mesa/state_tracker/st_texture.c | |
parent | 93e342574f5fc95789028dbe7cf637257562e9bb (diff) | |
parent | 4afed821baa6993d85a07c67d42ea40d4e9a600a (diff) |
Merge remote branch 'origin/master' into gallium_draw_llvm
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r-- | src/mesa/state_tracker/st_texture.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 10a38befb4..5809927852 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -342,21 +342,12 @@ st_texture_image_copy(struct pipe_context *pipe, src_surface = screen->get_tex_surface(screen, src, face, srcLevel, i, PIPE_BUFFER_USAGE_GPU_READ); - if (pipe->surface_copy) { - pipe->surface_copy(pipe, - dst_surface, - 0, 0, /* destX, Y */ - src_surface, - 0, 0, /* srcX, Y */ - width, height); - } else { - util_surface_copy(pipe, FALSE, - dst_surface, - 0, 0, /* destX, Y */ - src_surface, - 0, 0, /* srcX, Y */ - width, height); - } + pipe->surface_copy(pipe, + dst_surface, + 0, 0, /* destX, Y */ + src_surface, + 0, 0, /* srcX, Y */ + width, height); pipe_surface_reference(&src_surface, NULL); pipe_surface_reference(&dst_surface, NULL); @@ -528,14 +519,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 +563,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; |