diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index ed8eb29..9d26bcc 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -275,12 +275,9 @@ guess_and_alloc_texture(struct st_context *st, height = stImage->base.Height2; depth = stImage->base.Depth2; - assert(width > 0); - assert(height > 0); - assert(depth > 0); - /* Depending on the image's size, we can't always make a guess here. */ +#if 0 if (level > 0) { if ( (dims >= 1 && width == 1) || (dims >= 2 && height == 1) || @@ -290,6 +287,7 @@ guess_and_alloc_texture(struct st_context *st, return; } } +#endif /* grow the image size until we hit level = 0 */ while (level > 0) { @@ -300,10 +298,15 @@ guess_and_alloc_texture(struct st_context *st, if (depth != 1) depth <<= 1; level--; - } + } assert(level == 0); + if (width == 0 || height == 0 || depth == 0) { + /* no texture needed */ + return; + } + /* At this point, (width x height x depth) is the expected size of * the level=0 mipmap image. */