i965: Don't allocate a 1-level texture when GL_GENERATE_MIPMAP is set.
authorEric Anholt <eric@anholt.net>
Fri, 30 Aug 2013 19:47:02 +0000 (12:47 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 30 Sep 2013 21:35:42 +0000 (14:35 -0700)
Given that a teximage that calls us with this flag set will immediately
proceed to allocate the other levels, we can probably just go ahead and
allocate those levels now.

Reduces miptree copies in piglit by about .05%.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/intel_tex_image.c

index fe274bf1ae37fcb7ac4f3651307aefe964cbf903..16fed95d673a8638168dc77906965845f24fe52c 100644 (file)
@@ -60,7 +60,8 @@ intel_miptree_create_for_teximage(struct brw_context *brw,
     */
    if ((intelObj->base.Sampler.MinFilter == GL_NEAREST ||
         intelObj->base.Sampler.MinFilter == GL_LINEAR) &&
-       intelImage->base.Base.Level == 0) {
+       intelImage->base.Base.Level == 0 &&
+       !intelObj->base.GenerateMipmap) {
       lastLevel = 0;
    } else {
       lastLevel = _mesa_get_tex_max_num_levels(intelObj->base.Target,