i965/miptree: Prepare intel_miptree_copy() for isl based
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 22 Jun 2017 18:12:40 +0000 (21:12 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 20 Jul 2017 08:32:21 +0000 (11:32 +0300)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/intel_blit.c

index 4ffff76cc54a14423f3483da76c0f5c4ae363949..68e9c1ad162b5be45f15cfda4508489dc94b30c5 100644 (file)
@@ -406,10 +406,22 @@ intel_miptree_copy(struct brw_context *brw,
        */
       assert(src_x % bw == 0);
       assert(src_y % bh == 0);
-      assert(src_width % bw == 0 ||
-             src_x + src_width == minify(src_mt->logical_width0, src_level));
-      assert(src_height % bh == 0 ||
-             src_y + src_height == minify(src_mt->logical_height0, src_level));
+
+      if (src_mt->surf.size > 0) {
+         assert(src_width % bw == 0 ||
+                src_x + src_width ==
+                minify(src_mt->surf.logical_level0_px.width, src_level));
+         assert(src_height % bh == 0 ||
+                src_y + src_height ==
+                minify(src_mt->surf.logical_level0_px.height, src_level));
+      } else {
+         assert(src_width % bw == 0 ||
+                src_x + src_width ==
+                minify(src_mt->logical_width0, src_level));
+         assert(src_height % bh == 0 ||
+                src_y + src_height ==
+                minify(src_mt->logical_height0, src_level));
+      }
 
       src_x /= (int)bw;
       src_y /= (int)bh;