intel_finalize_mipmap_tree: Only flush batchbuffer when necessary.
authorMichel Dänzer <michel@tungstengraphics.com>
Thu, 21 Dec 2006 16:30:00 +0000 (17:30 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Tue, 9 Jan 2007 11:46:50 +0000 (12:46 +0100)
src/mesa/drivers/dri/i915tex/intel_tex_validate.c

index e73c9c2f2188ea7d2b61828af9522a95933eb478..79d587a17442e907c7b25442b2f49dd42a81c33d 100644 (file)
@@ -110,6 +110,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
    GLuint nr_faces = 0;
    struct intel_texture_image *firstImage;
 
+   GLboolean need_flush = GL_FALSE;
+
    /* We know/require this is true by now: 
     */
    assert(intelObj->base.Complete);
@@ -201,11 +203,13 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
           */
          if (intelObj->mt != intelImage->mt) {
             copy_image_data_to_tree(intel, intelObj, intelImage);
+           need_flush = GL_TRUE;
          }
       }
    }
 
-   intel_batchbuffer_flush(intel->batch);
+   if (need_flush)
+      intel_batchbuffer_flush(intel->batch);
 
    return GL_TRUE;
 }