aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_tile_cache.h
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-07-22 15:36:25 +0100
committerJosé Fonseca <[email protected]>2009-08-29 09:21:17 +0100
commit3adca9611479936eb0b719b276ac94889a7c6bf3 (patch)
tree92029dbbf1888243d54b1a6f0d546509f33f1d75 /src/gallium/drivers/llvmpipe/lp_tile_cache.h
parent2301314e7ccd37faae80353d35109bb029dc9335 (diff)
llvmpipe: also shortcircuit non-texture tile lookups
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_tile_cache.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_tile_cache.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.h b/src/gallium/drivers/llvmpipe/lp_tile_cache.h
index 06e9587da6e..1cc5a17bb59 100644
--- a/src/gallium/drivers/llvmpipe/lp_tile_cache.h
+++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.h
@@ -141,7 +141,8 @@ lp_tile_cache_clear(struct llvmpipe_tile_cache *tc, const float *rgba,
uint clearValue);
extern struct llvmpipe_cached_tile *
-lp_get_cached_tile(struct llvmpipe_tile_cache *tc, int x, int y);
+lp_find_cached_tile(struct llvmpipe_tile_cache *tc,
+ union tile_address addr );
extern const struct llvmpipe_cached_tile *
lp_find_cached_tile_tex(struct llvmpipe_tile_cache *tc,
@@ -179,6 +180,19 @@ lp_get_cached_tile_tex(struct llvmpipe_tile_cache *tc,
}
+static INLINE struct llvmpipe_cached_tile *
+lp_get_cached_tile(struct llvmpipe_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 lp_find_cached_tile( tc, addr );
+}
+
+
#endif /* LP_TILE_CACHE_H */