From 92fb742065f4de941e444916c5a146db87c71701 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 21 Dec 2006 17:30:00 +0100 Subject: intel_finalize_mipmap_tree: Only flush batchbuffer when necessary. --- src/mesa/drivers/dri/i915tex/intel_tex_validate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3