diff options
author | Jason Ekstrand <[email protected]> | 2016-03-30 16:15:54 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-04-08 15:57:58 -0700 |
commit | b37502b9832f02626b0caca22500b46ebbbe8007 (patch) | |
tree | 522de991713267d1351cac6b17b992784dde7278 /src/intel/vulkan | |
parent | 4caba940869602b750e21a444523b068b1bea339 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_meta_blit2d.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/intel/vulkan/anv_meta_blit2d.c b/src/intel/vulkan/anv_meta_blit2d.c index 8e63eee462d..cf2dc66597d 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, |