Mesa (staging/21.1): util/format: Change the pointer offset.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jun 5 16:30:18 UTC 2021


Module: Mesa
Branch: staging/21.1
Commit: 20c957803c077304295606f8785b29acd4aef778
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=20c957803c077304295606f8785b29acd4aef778

Author: Sergii Melikhov <sergii.v.melikhov at globallogic.com>
Date:   Thu May 27 14:46:04 2021 +0300

util/format: Change the pointer offset.

Changed the pointer offset to 2 to account for the second structure variable.

Fixes: 90f98b56f85 ("mesa: Deduplicate _mesa_pack_uint_z_row().")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4685
Signed-off-by: Sergii Melikhov <sergii.v.melikhov at globallogic.com>
Cc: mesa-stable at lists.freedesktop.org
Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11060>
(cherry picked from commit 8251bd216e7ff300b93788cd1e2d49c301f5fe49)

---

 .pick_status.json             | 2 +-
 src/util/format/u_format_zs.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index c58e91393ce..cc56684e990 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1057,7 +1057,7 @@
         "description": "util/format: Change the pointer offset.",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "90f98b56f8541a3e7bc96e1121f404350bb68cf8"
     },
diff --git a/src/util/format/u_format_zs.c b/src/util/format/u_format_zs.c
index 442a66f7a06..742c8f33c42 100644
--- a/src/util/format/u_format_zs.c
+++ b/src/util/format/u_format_zs.c
@@ -885,7 +885,8 @@ util_format_z32_float_s8x24_uint_pack_z_32unorm(uint8_t *restrict dst_row, unsig
       const uint32_t *src = src_row;
       float *dst = (float *)dst_row;
       for(x = 0; x < width; ++x) {
-         *dst++ = z32_unorm_to_z32_float(*src++);
+         *dst = z32_unorm_to_z32_float(*src++);
+         dst += 2;
       }
       dst_row += dst_stride/sizeof(*dst_row);
       src_row += src_stride/sizeof(*src_row);



More information about the mesa-commit mailing list