st/mesa: Check for single level mipmap trees.
authorYounes Manton <younes.m@gmail.com>
Mon, 21 Dec 2009 01:11:55 +0000 (20:11 -0500)
committerYounes Manton <younes.m@gmail.com>
Mon, 21 Dec 2009 05:59:06 +0000 (00:59 -0500)
The assert in util_gen_mipmap() caught it, although
it does the right thing anyway.

src/mesa/state_tracker/st_gen_mipmap.c

index f75b234..c3bea31 100644 (file)
@@ -215,6 +215,9 @@ st_generate_mipmap(GLcontext *ctx, GLenum target,
    /* find expected last mipmap level */
    lastLevel = compute_num_levels(ctx, texObj, target) - 1;
 
+   if (lastLevel == 0)
+      return;
+
    if (pt->last_level < lastLevel) {
       /* The current gallium texture doesn't have space for all the
        * mipmap levels we need to generate.  So allocate a new texture.