intel/isl: Add units to view dimensions in isl_surf_get_uncompressed_surf
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 5 Mar 2018 23:06:58 +0000 (15:06 -0800)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 17 Aug 2021 14:14:39 +0000 (09:14 -0500)
This makes things a bit more clear.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Acked-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11765>

src/intel/isl/isl.c

index 53adb4d..40cdfbd 100644 (file)
@@ -2847,13 +2847,14 @@ isl_surf_get_uncompressed_surf(const struct isl_device *dev,
    assert(isl_format_get_layout(view->format)->bpb == fmtl->bpb);
    assert(view->levels == 1);
 
-   const uint32_t view_width =
+   const uint32_t view_width_px =
       isl_minify(surf->logical_level0_px.width, view->base_level);
-   const uint32_t view_height =
+   const uint32_t view_height_px =
       isl_minify(surf->logical_level0_px.height, view->base_level);
 
-   const uint32_t ucompr_width = isl_align_div_npot(view_width, fmtl->bw);
-   const uint32_t ucompr_height = isl_align_div_npot(view_height, fmtl->bh);
+   assert(surf->samples == 1);
+   const uint32_t view_width_el = isl_align_div_npot(view_width_px, fmtl->bw);
+   const uint32_t view_height_el = isl_align_div_npot(view_height_px, fmtl->bh);
 
    /* If we ever enable 3D block formats, we'll need to re-think this */
    assert(fmtl->bd == 1);
@@ -2926,10 +2927,10 @@ isl_surf_get_uncompressed_surf(const struct isl_device *dev,
    /* We're making an uncompressed view here.  The image dimensions
     * need to be scaled down by the block size.
     */
-   assert(ucompr_surf->logical_level0_px.width == view_width);
-   assert(ucompr_surf->logical_level0_px.height == view_height);
-   ucompr_surf->logical_level0_px.width = ucompr_width;
-   ucompr_surf->logical_level0_px.height = ucompr_height;
+   assert(ucompr_surf->logical_level0_px.width == view_width_px);
+   assert(ucompr_surf->logical_level0_px.height == view_height_px);
+   ucompr_surf->logical_level0_px.width = view_width_el;
+   ucompr_surf->logical_level0_px.height = view_height_el;
    ucompr_surf->phys_level0_sa = isl_surf_get_phys_level0_el(surf);
 
    *x_offset_el = isl_assert_div(x_offset_sa, fmtl->bw);