gallium: use pipe_texture_reference() in sp_tile_cache_set_texture()
authorBrian <brian.paul@tungstengraphics.com>
Wed, 20 Feb 2008 18:15:59 +0000 (11:15 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Wed, 20 Feb 2008 18:15:59 +0000 (11:15 -0700)
src/gallium/drivers/softpipe/sp_state_sampler.c
src/gallium/drivers/softpipe/sp_tile_cache.c
src/gallium/drivers/softpipe/sp_tile_cache.h

index 460adccec4f0c57369e5b65d5421209475683a38..9246915e19e4bfa357249eea6e081a3a8f61c21a 100644 (file)
@@ -84,7 +84,7 @@ softpipe_set_sampler_texture(struct pipe_context *pipe,
    assert(unit < PIPE_MAX_SAMPLERS);
    softpipe->texture[unit] = softpipe_texture(texture);  /* ptr, not struct */
 
-   sp_tile_cache_set_texture(softpipe->tex_cache[unit], texture);
+   sp_tile_cache_set_texture(pipe, softpipe->tex_cache[unit], texture);
 
    softpipe->dirty |= SP_NEW_TEXTURE;
 }
index dde3fabc81ed7dd9f46dca00066b5c9f958186f4..9ed3c5072d018dc1a8abfeb16e1f3a6504f05bd1 100644 (file)
@@ -212,14 +212,15 @@ sp_tile_cache_unmap_surfaces(struct softpipe_tile_cache *tc)
  * Specify the texture to cache.
  */
 void
-sp_tile_cache_set_texture(struct softpipe_tile_cache *tc,
+sp_tile_cache_set_texture(struct pipe_context *pipe,
+                          struct softpipe_tile_cache *tc,
                           struct pipe_texture *texture)
 {
    uint i;
 
    assert(!tc->surface);
 
-   tc->texture = texture;
+   pipe_texture_reference(pipe, &tc->texture, texture);
 
    if (tc->tex_surf_map) {
       pipe_surface_unmap(tc->tex_surf);
index 7fd10812863e9f925712d3eac93a88ae635899a9..2631e29a3a6620dcac80b1ad397dcefee40bf2b2 100644 (file)
@@ -80,7 +80,8 @@ extern void
 sp_tile_cache_unmap_surfaces(struct softpipe_tile_cache *tc);
 
 extern void
-sp_tile_cache_set_texture(struct softpipe_tile_cache *tc,
+sp_tile_cache_set_texture(struct pipe_context *pipe,
+                          struct softpipe_tile_cache *tc,
                           struct pipe_texture *texture);
 
 extern void