diff options
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_image.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 7b9638f666a..8e623f05b5a 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -84,10 +84,10 @@ intel_miptree_create_for_teximage(struct intel_context *intel, intelImage->base.Base.Level == firstLevel && (intel->gen < 4 || firstLevel == 0)) { lastLevel = firstLevel; - } else if (intelObj->base.Target == GL_TEXTURE_EXTERNAL_OES) { - lastLevel = firstLevel; } else { - lastLevel = firstLevel + _mesa_logbase2(MAX2(MAX2(width, height), depth)); + lastLevel = (firstLevel + + _mesa_get_tex_max_num_levels(intelObj->base.Target, + width, height, depth) - 1); } } |