summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_tile_cache.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-09-23 11:00:04 -0600
committerBrian Paul <brianp@vmware.com>2009-09-23 11:00:04 -0600
commitde25f82067bca5231fb968190f6c12cb517d62ff (patch)
tree3575e6e6252b40bd1d2070e81b5a1c0fc9b8300d /src/gallium/drivers/softpipe/sp_tile_cache.c
parent890679d4322e7ba4f12f32532a3fdd277edff886 (diff)
parente41707becaffd604fedc885719e5b061a4a5b363 (diff)
Merge branch 'mesa_7_6_branch'
Conflicts: src/gallium/drivers/softpipe/sp_tile_cache.c
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_tile_cache.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index 608fbcc5896..de479709858 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -82,6 +82,12 @@ sp_create_tile_cache( struct pipe_screen *screen )
{
struct softpipe_tile_cache *tc;
uint pos;
+ int maxLevels, maxTexSize;
+
+ /* sanity checking: max sure MAX_WIDTH/HEIGHT >= largest texture image */
+ maxLevels = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
+ maxTexSize = 1 << (maxLevels - 1);
+ assert(MAX_WIDTH >= maxTexSize);
tc = CALLOC_STRUCT( softpipe_tile_cache );
if (tc) {