summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_tile_cache.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-09-23 10:50:38 -0600
committerBrian Paul <brianp@vmware.com>2009-09-23 10:50:38 -0600
commite41707becaffd604fedc885719e5b061a4a5b363 (patch)
tree675009f59e2ab47739d3c7d3e2fd74480c6b5888 /src/gallium/drivers/softpipe/sp_tile_cache.c
parent84b956c29be7eb547130974df9ceb3d2f3354526 (diff)
softpipe: added max texture/surface size sanity check
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 a524275a71c..461cbb9f953 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -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) {