summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_tile_cache.h
diff options
context:
space:
mode:
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 06e9587da6..1cc5a17bb5 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 */