llvmpipe: added max texture/surface size sanity check
Carried over from softpipe driver.
This commit is contained in:
parent
b26f1df920
commit
5244ce786a
|
@ -48,6 +48,12 @@ struct llvmpipe_tile_cache *
|
||||||
lp_create_tile_cache( struct pipe_screen *screen )
|
lp_create_tile_cache( struct pipe_screen *screen )
|
||||||
{
|
{
|
||||||
struct llvmpipe_tile_cache *tc;
|
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 );
|
tc = CALLOC_STRUCT( llvmpipe_tile_cache );
|
||||||
if(!tc)
|
if(!tc)
|
||||||
|
|
Loading…
Reference in New Issue