From: Michel Dänzer Date: Thu, 21 Dec 2006 16:30:00 +0000 (+0100) Subject: intel_finalize_mipmap_tree: Only flush batchbuffer when necessary. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=92fb742065f4de941e444916c5a146db87c71701;p=mesa.git intel_finalize_mipmap_tree: Only flush batchbuffer when necessary. --- diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c index e73c9c2f218..79d587a1744 100644 --- a/src/mesa/drivers/dri/i915tex/intel_tex_validate.c +++ b/src/mesa/drivers/dri/i915tex/intel_tex_validate.c @@ -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; }