softpipe: added max texture/surface size sanity check

This commit is contained in:
Brian Paul 2009-09-23 10:50:38 -06:00
parent 84b956c29b
commit e41707beca
1 changed files with 6 additions and 0 deletions

View File

@ -116,6 +116,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) {