Mesa (master): i965: Don' t allocate a 1-level texture when GL_GENERATE_MIPMAP is set.

Eric Anholt anholt at kemper.freedesktop.org
Mon Sep 30 21:36:03 UTC 2013


Module: Mesa
Branch: master
Commit: 97bdb4c039bb33dbbcbb43d0fd0bb24106777ae9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=97bdb4c039bb33dbbcbb43d0fd0bb24106777ae9

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Aug 30 12:47:02 2013 -0700

i965: Don't allocate a 1-level texture when GL_GENERATE_MIPMAP is set.

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 at linux.intel.com>

---

 src/mesa/drivers/dri/i965/intel_tex_image.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index fe274bf..16fed95 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -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,




More information about the mesa-commit mailing list