From: Younes Manton Date: Mon, 21 Dec 2009 01:11:55 +0000 (-0500) Subject: st/mesa: Check for single level mipmap trees. X-Git-Tag: mesa-7.8~1360^2~370^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ace937f1651c64d7fb22917489e29761130aaa0d;p=platform%2Fupstream%2Fmesa.git st/mesa: Check for single level mipmap trees. The assert in util_gen_mipmap() caught it, although it does the right thing anyway. --- diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index f75b234..c3bea31 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -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.