diff options
author | Nanley Chery <[email protected]> | 2016-03-04 11:43:19 -0800 |
---|---|---|
committer | Nanley Chery <[email protected]> | 2016-03-09 10:57:47 -0800 |
commit | 7ebbc3946ae9cffb3c3db522dcbe2f1041633164 (patch) | |
tree | 0a5aeb9f33afd2e43c72f9eb2f50998d0a367abd /src/intel/vulkan/anv_meta_blit.c | |
parent | 248ab61740c4082517424f5aa94b2f4e7b210d76 (diff) |
anv/meta: Minimize height of images used for copies
In addition to demystifying the value being added to the height,
this future-proofs the code for new tiling modes and keeps the
image height as small as possible.
v2: Actually use the smallest height possible.
Signed-off-by: Nanley Chery <[email protected]>
Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_meta_blit.c')
-rw-r--r-- | src/intel/vulkan/anv_meta_blit.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_meta_blit.c b/src/intel/vulkan/anv_meta_blit.c index b8a42f99eec..ecd4d2d3536 100644 --- a/src/intel/vulkan/anv_meta_blit.c +++ b/src/intel/vulkan/anv_meta_blit.c @@ -450,8 +450,7 @@ anv_meta_blit2d(struct anv_cmd_buffer *cmd_buffer, .format = 0, /* TEMPLATE */ .extent = { .width = 0, /* TEMPLATE */ - /* Pad to highest tile height to compensate for a vertical intratile offset */ - .height = MIN(rects[r].height + 64, 1 << 14), + .height = 0, /* TEMPLATE */ .depth = 1, }, .mipLevels = 1, @@ -465,11 +464,19 @@ anv_meta_blit2d(struct anv_cmd_buffer *cmd_buffer, .isl_tiling_flags = 0, /* TEMPLATE */ }; + /* The image height is the rect height + src/dst y-offset from the + * tile-aligned base address. + */ + struct isl_tile_info tile_info; + anv_image_info.isl_tiling_flags = 1 << src->tiling; image_info.tiling = anv_image_info.isl_tiling_flags == ISL_TILING_LINEAR_BIT ? VK_IMAGE_TILING_LINEAR : VK_IMAGE_TILING_OPTIMAL; image_info.usage = VK_IMAGE_USAGE_SAMPLED_BIT; image_info.format = src_format, + isl_tiling_get_info(&cmd_buffer->device->isl_dev, src->tiling, src->bs, &tile_info); + image_info.extent.height = rects[r].height + + rects[r].src_y % tile_info.height; image_info.extent.width = src->pitch / src->bs; VkImage src_image; anv_image_create(vk_device, &anv_image_info, @@ -480,6 +487,9 @@ anv_meta_blit2d(struct anv_cmd_buffer *cmd_buffer, VK_IMAGE_TILING_LINEAR : VK_IMAGE_TILING_OPTIMAL; image_info.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; image_info.format = dst_format, + isl_tiling_get_info(&cmd_buffer->device->isl_dev, dst->tiling, dst->bs, &tile_info); + image_info.extent.height = rects[r].height + + rects[r].dst_y % tile_info.height; image_info.extent.width = dst->pitch / dst->bs; VkImage dst_image; anv_image_create(vk_device, &anv_image_info, |