From: Adam Jackson Date: Mon, 30 Mar 2009 20:32:11 +0000 (-0400) Subject: intel: Avoid mapping the texture image for CopyTex{,Sub}Image X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=37fb2d9b23eab5dbbb43a212c3475cb8016837d8;p=mesa.git intel: Avoid mapping the texture image for CopyTex{,Sub}Image We don't upload the pixels with the CPU in that case, so the map will only serve as a way of triggering cache flushes over a bunch of data we don't touch. --- diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index e902187637d..61ecabfa680 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -482,12 +482,13 @@ intelTexImage(GLcontext * ctx, LOCK_HARDWARE(intel); if (intelImage->mt) { - texImage->Data = intel_miptree_image_map(intel, - intelImage->mt, - intelImage->face, - intelImage->level, - &dstRowStride, - intelImage->base.ImageOffsets); + if (pixels) + texImage->Data = intel_miptree_image_map(intel, + intelImage->mt, + intelImage->face, + intelImage->level, + &dstRowStride, + intelImage->base.ImageOffsets); texImage->RowStride = dstRowStride / intelImage->mt->cpp; } else { @@ -537,17 +538,18 @@ intelTexImage(GLcontext * ctx, format, type, pixels, unpack)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); } - } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - intel_generate_mipmap(ctx, target, texObj); + /* GL_SGIS_generate_mipmap */ + if (level == texObj->BaseLevel && texObj->GenerateMipmap) { + intel_generate_mipmap(ctx, target, texObj); + } } _mesa_unmap_teximage_pbo(ctx, unpack); if (intelImage->mt) { - intel_miptree_image_unmap(intel, intelImage->mt); + if (pixels) + intel_miptree_image_unmap(intel, intelImage->mt); texImage->Data = NULL; }