diff options
author | Brian Paul <brianp@vmware.com> | 2009-09-23 11:04:57 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-09-23 11:05:00 -0600 |
commit | 5244ce786a3e115fac1675450c3df8ee11e20030 (patch) | |
tree | 7f628728df8f56c6c84fd8ad36930def370113c7 /src/gallium/drivers/llvmpipe | |
parent | b26f1df920a712da66c72f801e3292bf44ea9a83 (diff) |
llvmpipe: added max texture/surface size sanity check
Carried over from softpipe driver.
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_tile_cache.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c index 2e576e6039..73460106f3 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) |