From de33c23370bf37b2a2fdf5be1daab6007d054c08 Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Tue, 11 Feb 2020 22:16:22 -0500 Subject: [PATCH] turnip: minify image_view extent Signed-off-by: Jonathan Marek Reviewed-by: Eric Anholt Part-of: --- src/freedreno/vulkan/tu_image.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c index 9f22c93e0ed..d77f3c8df43 100644 --- a/src/freedreno/vulkan/tu_image.c +++ b/src/freedreno/vulkan/tu_image.c @@ -265,14 +265,15 @@ tu_image_view_init(struct tu_image_view *iview, iview->vk_format = pCreateInfo->format; iview->aspect_mask = pCreateInfo->subresourceRange.aspectMask; - // should we minify? - iview->extent = image->extent; - iview->base_layer = range->baseArrayLayer; iview->layer_count = tu_get_layerCount(image, range); iview->base_mip = range->baseMipLevel; iview->level_count = tu_get_levelCount(image, range); + iview->extent.width = u_minify(image->extent.width, iview->base_mip); + iview->extent.height = u_minify(image->extent.height, iview->base_mip); + iview->extent.depth = u_minify(image->extent.depth, iview->base_mip); + memset(iview->descriptor, 0, sizeof(iview->descriptor)); struct tu_native_format fmt = @@ -282,10 +283,10 @@ tu_image_view_init(struct tu_image_view *iview, uint32_t pitch = tu_image_stride(image, iview->base_mip) / vk_format_get_blockwidth(iview->vk_format); enum a6xx_tile_mode tile_mode = tu6_get_image_tile_mode(image, iview->base_mip); - uint32_t width = u_minify(image->extent.width, iview->base_mip); - uint32_t height = u_minify(image->extent.height, iview->base_mip); + uint32_t width = iview->extent.width; + uint32_t height = iview->extent.height; uint32_t depth = pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_3D ? - u_minify(image->extent.depth, iview->base_mip) : iview->layer_count; + iview->extent.depth : iview->layer_count; unsigned fmt_tex = fmt.fmt; if (iview->aspect_mask == VK_IMAGE_ASPECT_STENCIL_BIT && -- 2.30.2