i965: Use offset helper in intel_readpixels_tiled_memcpy()
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Wed, 28 Jun 2017 06:14:02 +0000 (09:14 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Tue, 18 Jul 2017 18:36:13 +0000 (21:36 +0300)
providing support for isl based.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/intel_pixel_read.c

index 871559edf9e4bc254890358562f301dd6d647425..8eab0a5c12e01daf08d501ab1ee53da7f6f49a5a 100644 (file)
@@ -162,8 +162,11 @@ intel_readpixels_tiled_memcpy(struct gl_context * ctx,
       return false;
    }
 
-   xoffset += irb->mt->level[irb->mt_level].slice[irb->mt_layer].x_offset;
-   yoffset += irb->mt->level[irb->mt_level].slice[irb->mt_layer].y_offset;
+   unsigned slice_offset_x, slice_offset_y;
+   intel_miptree_get_image_offset(irb->mt, irb->mt_level, irb->mt_layer,
+                                  &slice_offset_x, &slice_offset_y);
+   xoffset += slice_offset_x;
+   yoffset += slice_offset_y;
 
    dst_pitch = _mesa_image_row_stride(pack, width, format, type);