diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-07-22 15:36:25 +0100 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2009-07-23 09:35:33 +0100 |
commit | 19097907ef042b97bbbda39b34bf3212f4cf154a (patch) | |
tree | e9327de728929c41c40c1afc75d826a881aa8633 /src/gallium/drivers/softpipe/sp_tile_cache.h | |
parent | f911c3b9897b90132c8621a72bfeb824eb3b01e5 (diff) |
softpipe: also shortcircuit non-texture tile lookups
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_tile_cache.h')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_tile_cache.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.h b/src/gallium/drivers/softpipe/sp_tile_cache.h index 3017fcbebc..ac2aae5875 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.h +++ b/src/gallium/drivers/softpipe/sp_tile_cache.h @@ -141,7 +141,8 @@ sp_tile_cache_clear(struct softpipe_tile_cache *tc, const float *rgba, uint clearValue); extern struct softpipe_cached_tile * -sp_get_cached_tile(struct softpipe_tile_cache *tc, int x, int y); +sp_find_cached_tile(struct softpipe_tile_cache *tc, + union tile_address addr ); extern const struct softpipe_cached_tile * sp_find_cached_tile_tex(struct softpipe_tile_cache *tc, @@ -179,6 +180,19 @@ sp_get_cached_tile_tex(struct softpipe_tile_cache *tc, } +static INLINE struct softpipe_cached_tile * +sp_get_cached_tile(struct softpipe_tile_cache *tc, + int x, int y ) +{ + union tile_address addr = tile_address( x, y, 0, 0, 0 ); + + if (tc->last_tile->addr.value == addr.value) + return tc->last_tile; + + return sp_find_cached_tile( tc, addr ); +} + + #endif /* SP_TILE_CACHE_H */ |