[Mesa-dev] [PATCH] anv/meta: Use ISL to get the image tile height
Anuj Phogat
anuj.phogat at gmail.com
Tue Mar 8 18:41:24 UTC 2016
On Fri, Mar 4, 2016 at 2:03 PM, Nanley Chery <nanleychery at gmail.com> wrote:
> From: Nanley Chery <nanley.g.chery at intel.com>
>
> In addition to making the height addition more understandable, this
> future-proofs the code for new tiling modes and keeps the image
> height as small as possible.
>
> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
> src/intel/vulkan/anv_meta_blit.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_meta_blit.c b/src/intel/vulkan/anv_meta_blit.c
> index b8a42f9..8b5873e 100644
> --- a/src/intel/vulkan/anv_meta_blit.c
> +++ b/src/intel/vulkan/anv_meta_blit.c
> @@ -443,6 +443,12 @@ anv_meta_blit2d(struct anv_cmd_buffer *cmd_buffer,
>
> for (unsigned r = 0; r < num_rects; ++r) {
>
> + /* Used to store the height of a tile in the src/dst surface.
> + * The tile height is added to the image height to compensate
> + * for the rect's src/dst y-offsets.
> + */
> + struct isl_tile_info tile_info;
> +
> /* Create VkImages */
> VkImageCreateInfo image_info = {
> .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
> @@ -450,8 +456,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,
> @@ -470,6 +475,8 @@ anv_meta_blit2d(struct anv_cmd_buffer *cmd_buffer,
> 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 = MIN(rects[r].height + tile_info.height, 1 << 14);
> image_info.extent.width = src->pitch / src->bs;
> VkImage src_image;
> anv_image_create(vk_device, &anv_image_info,
> @@ -480,6 +487,8 @@ 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 = MIN(rects[r].height + tile_info.height, 1 << 14);
> image_info.extent.width = dst->pitch / dst->bs;
> VkImage dst_image;
> anv_image_create(vk_device, &anv_image_info,
> --
> 2.7.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
LGTM.
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
More information about the mesa-dev
mailing list