Mesa (main): intel/isl: Add units to view dimensions in isl_surf_get_uncompressed_surf

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 17 14:53:59 UTC 2021


Module: Mesa
Branch: main
Commit: 9ab2f7d489db67323bb0f7daf7062d23061a30a6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9ab2f7d489db67323bb0f7daf7062d23061a30a6

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Mon Mar  5 15:06:58 2018 -0800

intel/isl: Add units to view dimensions in isl_surf_get_uncompressed_surf

This makes things a bit more clear.

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

---

 src/intel/isl/isl.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index 53adb4dbbde..40cdfbde594 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -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);



More information about the mesa-commit mailing list