summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYounes Manton <younes.m@gmail.com>2009-12-20 20:11:55 -0500
committerYounes Manton <younes.m@gmail.com>2009-12-21 00:59:06 -0500
commitace937f1651c64d7fb22917489e29761130aaa0d (patch)
treee9c859143bf6a300c8586278299febc789036170
parentb96a5df5141390b5cb31c0eac6449239c6cb750e (diff)
st/mesa: Check for single level mipmap trees.
The assert in util_gen_mipmap() caught it, although it does the right thing anyway.
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index f75b2348b8..c3bea3172a 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.