From: Brian Paul Date: Wed, 23 Sep 2009 17:04:57 +0000 (-0600) Subject: llvmpipe: added max texture/surface size sanity check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5244ce786a3e115fac1675450c3df8ee11e20030;p=mesa.git llvmpipe: added max texture/surface size sanity check Carried over from softpipe driver. --- diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c index 2e576e6039d..73460106f38 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c @@ -48,6 +48,12 @@ struct llvmpipe_tile_cache * lp_create_tile_cache( struct pipe_screen *screen ) { struct llvmpipe_tile_cache *tc; + 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( llvmpipe_tile_cache ); if(!tc)