From df3361df01e35aae9f379f0687490ba409841cfb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 13 Nov 2012 12:45:35 -0800 Subject: [PATCH] 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 --- src/mesa/drivers/dri/intel/intel_tex_image.c | 6 +++--- 1 file 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); } } -- 2.30.2