summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorAdam Jackson <[email protected]>2009-03-30 16:32:11 -0400
committerAdam Jackson <[email protected]>2009-03-30 16:32:11 -0400
commit37fb2d9b23eab5dbbb43a212c3475cb8016837d8 (patch)
tree7c89bed829d406647a30f1ac33eba385bf6d274d /src/mesa/drivers
parentf24ce499691a342b680e6c3d7aa257480e5d69d9 (diff)
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.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c24
1 files changed, 13 insertions, 11 deletions
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;
}