struct brw_context *brw = brw_context(ctx);
struct intel_mipmap_tree *src_mt, *dst_mt;
unsigned src_level, dst_level;
+ GLuint bw, bh;
if (_mesa_meta_CopyImageSubData_uncompressed(ctx,
src_image, src_renderbuffer,
intel_miptree_all_slices_resolve_depth(brw, dst_mt);
intel_miptree_resolve_color(brw, dst_mt);
+ _mesa_get_format_block_size(src_mt->format, &bw, &bh);
+
+ /* It's legal to have a WxH that's smaller than a compressed block. This
+ * happens for example when you are using a higher level LOD. For this case,
+ * we still want to copy the entire block, or else the decompression will be
+ * incorrect.
+ */
+ if (src_width < bw)
+ src_width = ALIGN_NPOT(src_width, bw);
+
+ if (src_height < bh)
+ src_height = ALIGN_NPOT(src_height, bh);
+
if (copy_image_with_blitter(brw, src_mt, src_level,
src_x, src_y, src_z,
dst_mt, dst_level,