Mesa (master): mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-up

Brian Paul brianp at kemper.freedesktop.org
Wed Mar 26 16:42:16 UTC 2014


Module: Mesa
Branch: master
Commit: 1f4ebfaa889ba3c9ff2154459544984e45ae4714
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1f4ebfaa889ba3c9ff2154459544984e45ae4714

Author: Brian Paul <brianp at vmware.com>
Date:   Sat Mar 22 11:23:32 2014 -0600

mesa: fix unpack_Z32_FLOAT_X24S8() / unpack_Z32_FLOAT() mix-up

And use the z32f_x24s8 helper struct in unpack_Z32_FLOAT_X24S8().
Cc: "10.0" "10.1" <mesa-stable at lists.freedesktop.org>

Reviewed-by: Roland Scheidegger <sroland at vmware.com>

---

 src/mesa/main/format_unpack.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index ea1ac38..2ef2e31 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -717,20 +717,20 @@ unpack_Z32(const void *src, GLfloat dst[][4], GLuint n)
 }
 
 static void
-unpack_Z32_FLOAT(const void *src, GLfloat dst[][4], GLuint n)
+unpack_Z32_FLOAT_X24S8(const void *src, GLfloat dst[][4], GLuint n)
 {
-   const GLfloat *s = ((const GLfloat *) src);
+   const struct z32f_x24s8 *s = (const struct z32f_x24s8 *) src;
    GLuint i;
    for (i = 0; i < n; i++) {
       dst[i][0] =
       dst[i][1] =
-      dst[i][2] = s[i * 2];
+      dst[i][2] = s[i].z;
       dst[i][3] = 1.0F;
    }
 }
 
 static void
-unpack_Z32_FLOAT_X24S8(const void *src, GLfloat dst[][4], GLuint n)
+unpack_Z32_FLOAT(const void *src, GLfloat dst[][4], GLuint n)
 {
    const GLfloat *s = ((const GLfloat *) src);
    GLuint i;




More information about the mesa-commit mailing list