mesa: Allow setting GL_TEXTURE_MAX_LEVEL to 0 with GL_TEXTURE_RECTANGLE.
[mesa.git] / src / mesa / main / format_unpack.c
index 256f9310c4bb79a2236096704e3ef13e684d37c6..2ef2e31d666778755a0f1aa73aac55e6ac691c5e 100644 (file)
@@ -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;
@@ -3963,7 +3963,7 @@ unpack_float_z_X8_Z24(GLuint n, const void *src, GLfloat *dst)
 }
 
 static void
-unpack_float_z_Z16(GLuint n, const void *src, GLfloat *dst)
+unpack_float_Z_UNORM16(GLuint n, const void *src, GLfloat *dst)
 {
    const GLushort *s = ((const GLushort *) src);
    GLuint i;
@@ -3973,7 +3973,7 @@ unpack_float_z_Z16(GLuint n, const void *src, GLfloat *dst)
 }
 
 static void
-unpack_float_z_Z32(GLuint n, const void *src, GLfloat *dst)
+unpack_float_Z_UNORM32(GLuint n, const void *src, GLfloat *dst)
 {
    const GLuint *s = ((const GLuint *) src);
    GLuint i;
@@ -4020,10 +4020,10 @@ _mesa_unpack_float_z_row(mesa_format format, GLuint n,
       unpack = unpack_float_z_X8_Z24;
       break;
    case MESA_FORMAT_Z_UNORM16:
-      unpack = unpack_float_z_Z16;
+      unpack = unpack_float_Z_UNORM16;
       break;
    case MESA_FORMAT_Z_UNORM32:
-      unpack = unpack_float_z_Z32;
+      unpack = unpack_float_Z_UNORM32;
       break;
    case MESA_FORMAT_Z_FLOAT32:
       unpack = unpack_float_z_Z32F;
@@ -4067,7 +4067,7 @@ unpack_uint_z_X8_Z24(const void *src, GLuint *dst, GLuint n)
 }
 
 static void
-unpack_uint_z_Z16(const void *src, GLuint *dst, GLuint n)
+unpack_uint_Z_UNORM16(const void *src, GLuint *dst, GLuint n)
 {
    const GLushort *s = ((const GLushort *)src);
    GLuint i;
@@ -4077,13 +4077,13 @@ unpack_uint_z_Z16(const void *src, GLuint *dst, GLuint n)
 }
 
 static void
-unpack_uint_z_Z32(const void *src, GLuint *dst, GLuint n)
+unpack_uint_Z_UNORM32(const void *src, GLuint *dst, GLuint n)
 {
    memcpy(dst, src, n * sizeof(GLuint));
 }
 
 static void
-unpack_uint_z_Z32_FLOAT(const void *src, GLuint *dst, GLuint n)
+unpack_uint_Z_FLOAT32(const void *src, GLuint *dst, GLuint n)
 {
    const float *s = (const float *)src;
    GLuint i;
@@ -4093,7 +4093,7 @@ unpack_uint_z_Z32_FLOAT(const void *src, GLuint *dst, GLuint n)
 }
 
 static void
-unpack_uint_z_Z32_FLOAT_X24S8(const void *src, GLuint *dst, GLuint n)
+unpack_uint_Z_FLOAT32_X24S8(const void *src, GLuint *dst, GLuint n)
 {
    const struct z32f_x24s8 *s = (const struct z32f_x24s8 *) src;
    GLuint i;
@@ -4125,16 +4125,16 @@ _mesa_unpack_uint_z_row(mesa_format format, GLuint n,
       unpack = unpack_uint_z_X8_Z24;
       break;
    case MESA_FORMAT_Z_UNORM16:
-      unpack = unpack_uint_z_Z16;
+      unpack = unpack_uint_Z_UNORM16;
       break;
    case MESA_FORMAT_Z_UNORM32:
-      unpack = unpack_uint_z_Z32;
+      unpack = unpack_uint_Z_UNORM32;
       break;
    case MESA_FORMAT_Z_FLOAT32:
-      unpack = unpack_uint_z_Z32_FLOAT;
+      unpack = unpack_uint_Z_FLOAT32;
       break;
    case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
-      unpack = unpack_uint_z_Z32_FLOAT_X24S8;
+      unpack = unpack_uint_Z_FLOAT32_X24S8;
       break;
    default:
       _mesa_problem(NULL, "bad format %s in _mesa_unpack_uint_z_row",