Mesa (main): util/format: Change the pointer offset.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 3 05:11:33 UTC 2021
Module: Mesa
Branch: main
Commit: 8251bd216e7ff300b93788cd1e2d49c301f5fe49
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8251bd216e7ff300b93788cd1e2d49c301f5fe49
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>
---
src/util/format/u_format_zs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/util/format/u_format_zs.c b/src/util/format/u_format_zs.c
index 05f023c6c26..0bd5025d2a5 100644
--- a/src/util/format/u_format_zs.c
+++ b/src/util/format/u_format_zs.c
@@ -858,7 +858,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