i965: Prepare image setup from miptree for isl based
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 22 Jun 2017 18:50:18 +0000 (21:50 +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_screen.c

index 47354b82c42b426041de194c4f992ae2a6686efb..44ea6a4562cba8ded55fabcb298163d86f542154 100644 (file)
@@ -410,8 +410,15 @@ intel_setup_image_from_mipmap_tree(struct brw_context *brw, __DRIimage *image,
 
    intel_miptree_check_level_layer(mt, level, zoffset);
 
-   image->width = minify(mt->physical_width0, level - mt->first_level);
-   image->height = minify(mt->physical_height0, level - mt->first_level);
+   if (mt->surf.size > 0) {
+      image->width = minify(mt->surf.phys_level0_sa.width,
+                            level - mt->first_level);
+      image->height = minify(mt->surf.phys_level0_sa.height,
+                             level - mt->first_level);
+   } else {
+      image->width = minify(mt->physical_width0, level - mt->first_level);
+      image->height = minify(mt->physical_height0, level - mt->first_level);
+   }
    image->pitch = mt->surf.row_pitch;
 
    image->offset = intel_miptree_get_tile_offsets(mt, level, zoffset,