From: Eric Anholt Date: Tue, 13 Nov 2012 20:45:35 +0000 (-0800) Subject: intel: Use core mesa support for determining lastLevel. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df3361df01e35aae9f379f0687490ba409841cfb;p=mesa.git intel: Use core mesa support for determining lastLevel. We had similar issues with using depth in determining the lastLevel of array textures. Reviewed-by: Chad Versace --- 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); } }