projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84b956c
)
softpipe: added max texture/surface size sanity check
author
Brian Paul
<brianp@vmware.com>
Wed, 23 Sep 2009 16:50:38 +0000
(10:50 -0600)
committer
Brian Paul
<brianp@vmware.com>
Wed, 23 Sep 2009 16:50:38 +0000
(10:50 -0600)
src/gallium/drivers/softpipe/sp_tile_cache.c
patch
|
blob
|
history
diff --git
a/src/gallium/drivers/softpipe/sp_tile_cache.c
b/src/gallium/drivers/softpipe/sp_tile_cache.c
index a524275a71c599dd41b9b2a84e28c1c8f1bb7924..461cbb9f95350b82f57276268b2cfa6c0d5814b9 100644
(file)
--- 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) {