Mesa (main): panfrost: Rename away from bytes_per_pixel

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 3 14:38:09 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Wed Apr 27 11:24:57 2022 -0400

panfrost: Rename away from bytes_per_pixel

This name is wrong for block-compressed formats. The code worked out anyway, but
rename it for clarity.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>

---

 src/panfrost/lib/pan_layout.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/panfrost/lib/pan_layout.c b/src/panfrost/lib/pan_layout.c
index e033dc2bf25..0d9f56c590f 100644
--- a/src/panfrost/lib/pan_layout.c
+++ b/src/panfrost/lib/pan_layout.c
@@ -212,7 +212,7 @@ pan_image_layout_init(struct pan_image_layout *layout,
         if (explicit_layout && (explicit_layout->offset & 63))
                 return false;
 
-        unsigned bytes_per_pixel = util_format_get_blocksize(layout->format);
+        unsigned fmt_blocksize = util_format_get_blocksize(layout->format);
 
         /* MSAA is implemented as a 3D texture with z corresponding to the
          * sample #, horrifyingly enough */
@@ -245,8 +245,7 @@ pan_image_layout_init(struct pan_image_layout *layout,
 
                 slice->offset = offset;
 
-                /* Compute the would-be stride */
-                unsigned row_stride = bytes_per_pixel * effective_width * block_size.height;
+                unsigned row_stride = fmt_blocksize * effective_width * block_size.height;
 
                 if (explicit_layout) {
                         /* Make sure the explicit stride is valid */



More information about the mesa-commit mailing list