That's taken care of in

void
lp_tex_tile_cache_validate_texture(struct llvmpipe_tex_tile_cache *tc)
{
   if (tc->texture) {
      struct llvmpipe_texture *lpt = llvmpipe_texture(tc->texture);
      if (lpt->timestamp != tc->timestamp) {
         /* texture was modified, invalidate all cached tiles */
         uint i;
         _debug_printf("INV %d %d\n", tc->timestamp, lpt->timestamp);
         for (i = 0; i < NUM_ENTRIES; i++) {
            tc->entries[i].addr.bits.invalid = 1;
         }

         tc->timestamp = lpt->timestamp;
      }
   }
}

timestamp is incremented whenever the textures is written by CPU or GPU.

I also tested gearbox.

Jose


On Tue, 2009-09-01 at 00:48 -0700, Keith Whitwell wrote:
> I'm not sure this is valid.  The cache is read-only, but textures can
> get modified by other actions, rendering the cached copy invalid -
> that's the point of the flush.
> 
> Keith
> 
> On Sun, 2009-08-30 at 04:37 -0700, Jose Fonseca wrote:
> > Module: Mesa
> > Branch: master
> > Commit: ffe1b7bad82726da44bf91bd61ca62e5cf6645de
> > URL:    
> > http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffe1b7bad82726da44bf91bd61ca62e5cf6645de
> > 
> > Author: José Fonseca <[email protected]>
> > Date:   Sun Aug 30 12:03:49 2009 +0100
> > 
> > llvmpipe: Texture cache is read-only. No need to flush.
> > 
> > ---
> > 
> >  src/gallium/drivers/llvmpipe/lp_flush.c     |    6 ----
> >  src/gallium/drivers/llvmpipe/lp_tex_cache.c |   39 
> > ---------------------------
> >  src/gallium/drivers/llvmpipe/lp_tex_cache.h |    3 --
> >  3 files changed, 0 insertions(+), 48 deletions(-)
> > 
> > diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c 
> > b/src/gallium/drivers/llvmpipe/lp_flush.c
> > index 44b4696..b5c1c95 100644
> > --- a/src/gallium/drivers/llvmpipe/lp_flush.c
> > +++ b/src/gallium/drivers/llvmpipe/lp_flush.c
> > @@ -51,12 +51,6 @@ llvmpipe_flush( struct pipe_context *pipe,
> >  
> >     draw_flush(llvmpipe->draw);
> >  
> > -   if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
> > -      for (i = 0; i < llvmpipe->num_textures; i++) {
> > -         lp_flush_tex_tile_cache(llvmpipe->tex_cache[i]);
> > -      }
> > -   }
> > -
> >     if (flags & PIPE_FLUSH_SWAPBUFFERS) {
> >        /* If this is a swapbuffers, just flush color buffers.
> >         *
> > diff --git a/src/gallium/drivers/llvmpipe/lp_tex_cache.c 
> > b/src/gallium/drivers/llvmpipe/lp_tex_cache.c
> > index 984f716..3069c76 100644
> > --- a/src/gallium/drivers/llvmpipe/lp_tex_cache.c
> > +++ b/src/gallium/drivers/llvmpipe/lp_tex_cache.c
> > @@ -201,45 +201,6 @@ lp_tex_tile_cache_set_texture(struct 
> > llvmpipe_tex_tile_cache *tc,
> >  
> > 
> >  /**
> > - * Flush the tile cache: write all dirty tiles back to the transfer.
> > - * any tiles "flagged" as cleared will be "really" cleared.
> > - */
> > -void
> > -lp_flush_tex_tile_cache(struct llvmpipe_tex_tile_cache *tc)
> > -{
> > -   struct pipe_transfer *pt = tc->transfer;
> > -   int inuse = 0, pos;
> > -
> > -   if (pt) {
> > -      /* caching a drawing transfer */
> > -      for (pos = 0; pos < NUM_ENTRIES; pos++) {
> > -         struct llvmpipe_cached_tex_tile *tile = tc->entries + pos;
> > -         if (!tile->addr.bits.invalid) {
> > -            pipe_put_tile_rgba(pt,
> > -                               tile->addr.bits.x * TEX_TILE_SIZE,
> > -                               tile->addr.bits.y * TEX_TILE_SIZE,
> > -                               TEX_TILE_SIZE, TEX_TILE_SIZE,
> > -                               (float *) tile->color);
> > -            tile->addr.bits.invalid = 1;  /* mark as empty */
> > -            inuse++;
> > -         }
> > -      }
> > -   }
> > -   else if (tc->texture) {
> > -      /* caching a texture, mark all entries as empty */
> > -      for (pos = 0; pos < NUM_ENTRIES; pos++) {
> > -         tc->entries[pos].addr.bits.invalid = 1;
> > -      }
> > -      tc->tex_face = -1;
> > -   }
> > -
> > -#if 0
> > -   debug_printf("flushed tiles in use: %d\n", inuse);
> > -#endif
> > -}
> > -
> > -
> > -/**
> >   * Given the texture face, level, zslice, x and y values, compute
> >   * the cache entry position/index where we'd hope to find the
> >   * cached texture tile.
> > diff --git a/src/gallium/drivers/llvmpipe/lp_tex_cache.h 
> > b/src/gallium/drivers/llvmpipe/lp_tex_cache.h
> > index f521b2a..106b505 100644
> > --- a/src/gallium/drivers/llvmpipe/lp_tex_cache.h
> > +++ b/src/gallium/drivers/llvmpipe/lp_tex_cache.h
> > @@ -111,9 +111,6 @@ lp_tex_tile_cache_set_texture(struct 
> > llvmpipe_tex_tile_cache *tc,
> >  void
> >  lp_tex_tile_cache_validate_texture(struct llvmpipe_tex_tile_cache *tc);
> >  
> > -extern void
> > -lp_flush_tex_tile_cache(struct llvmpipe_tex_tile_cache *tc);
> > -
> >  extern const struct llvmpipe_cached_tex_tile *
> >  lp_find_cached_tex_tile(struct llvmpipe_tex_tile_cache *tc,
> >                          union tex_tile_address addr );
> > 
> > _______________________________________________
> > mesa-commit mailing list
> > [email protected]
> > http://lists.freedesktop.org/mailman/listinfo/mesa-commit
> 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to