summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.h10
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c12
3 files changed, 22 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index 6e127dc31e7..fdd99edda7b 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -130,7 +130,7 @@ intel_region_release(struct intel_region **region)
/*
* XXX Move this into core Mesa?
*/
-static void
+void
_mesa_copy_rect(GLubyte * dst,
GLuint cpp,
GLuint dst_pitch,
diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h
index b6a3b5a7397..0d1dabe9ca7 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.h
+++ b/src/mesa/drivers/dri/intel/intel_regions.h
@@ -122,4 +122,14 @@ dri_bo *intel_region_buffer(struct intel_context *intel,
struct intel_region *region,
GLuint flag);
+void _mesa_copy_rect(GLubyte * dst,
+ GLuint cpp,
+ GLuint dst_pitch,
+ GLuint dst_x,
+ GLuint dst_y,
+ GLuint width,
+ GLuint height,
+ const GLubyte * src,
+ GLuint src_pitch, GLuint src_x, GLuint src_y);
+
#endif
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 4f5f75d0492..8f9f9897e87 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -493,7 +493,17 @@ intelTexImage(GLcontext * ctx,
* conversion and copy:
*/
if (compressed) {
- memcpy(texImage->Data, pixels, imageSize);
+ if (intelImage->mt) {
+ struct intel_region *dst = intelImage->mt->region;
+ _mesa_copy_rect(texImage->Data, dst->cpp, dst->pitch,
+ 0, 0,
+ intelImage->mt->level[intelImage->level].width,
+ intelImage->mt->level[intelImage->level].height/4,
+ pixels,
+ intelImage->base.RowStride,
+ 0, 0);
+ } else
+ memcpy(texImage->Data, pixels, imageSize);
} else if (!texImage->TexFormat->StoreImage(ctx, dims,
texImage->_BaseFormat,
texImage->TexFormat,