aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2020-02-11 22:16:22 -0500
committerMarge Bot <[email protected]>2020-02-28 14:04:20 +0000
commitde33c23370bf37b2a2fdf5be1daab6007d054c08 (patch)
treee9bf9b02423dd090c9020f7e05f4a2d6d470d252 /src
parentb18d6575fee00ed9db3c89b4e8c0756cc52d53e0 (diff)
turnip: minify image_view extent
Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
Diffstat (limited to 'src')
-rw-r--r--src/freedreno/vulkan/tu_image.c13
1 files 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 &&