From b37502b9832f02626b0caca22500b46ebbbe8007 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 30 Mar 2016 16:15:54 -0700 Subject: isl: Rework the get_intratile_offset function The old function tried to work in elements which isn't, strictly speaking, a valid thing to do. In the case of a non-power-of-two format, there is no guarantee that the x offset into the tile is a multiple of the format block size. This commit refactors it to work entirely in terms of a tiling (not a surface) and bytes/rows. Reviewed-by: Nanley Chery --- src/intel/vulkan/anv_meta_blit2d.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/intel/vulkan') diff --git a/src/intel/vulkan/anv_meta_blit2d.c b/src/intel/vulkan/anv_meta_blit2d.c index 8e63eee..cf2dc66 100644 --- a/src/intel/vulkan/anv_meta_blit2d.c +++ b/src/intel/vulkan/anv_meta_blit2d.c @@ -145,12 +145,15 @@ create_iview(struct anv_cmd_buffer *cmd_buffer, /* Create a VkImageView that starts at the tile aligned offset closest * to the provided x/y offset into the surface. */ + struct isl_surf *isl_surf = &anv_image_from_handle(*img)->color_surface.isl; + uint32_t img_o = 0; - isl_surf_get_image_intratile_offset_el_xy(&cmd_buffer->device->isl_dev, - &anv_image_from_handle(*img)-> - color_surface.isl, - *rect_x, *rect_y, - &img_o, rect_x, rect_y); + isl_tiling_get_intratile_offset_el(&cmd_buffer->device->isl_dev, + isl_surf->tiling, surf->bs, + isl_surf->row_pitch, + *rect_x * surf->bs, *rect_y, + &img_o, rect_x, rect_y); + anv_image_view_init(iview, cmd_buffer->device, &(VkImageViewCreateInfo) { .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, -- cgit v1.1