+ const GLbyte *s = (const GLbyte *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*4+0];
+ dst[i][GCOMP] = (GLfloat) s[i*4+1];
+ dst[i][BCOMP] = (GLfloat) s[i*4+2];
+ dst[i][ACOMP] = (GLfloat) s[i*4+3];
+ }
+}
+
+static void
+unpack_R_INT16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLshort *s = (const GLshort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i];
+ dst[i][GCOMP] = 0.0;
+ dst[i][BCOMP] = 0.0;
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RG_INT16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLshort *s = (const GLshort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*2+0];
+ dst[i][GCOMP] = (GLfloat) s[i*2+1];
+ dst[i][BCOMP] = 0.0;
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RGB_INT16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLshort *s = (const GLshort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*3+0];
+ dst[i][GCOMP] = (GLfloat) s[i*3+1];
+ dst[i][BCOMP] = (GLfloat) s[i*3+2];
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RGBA_INT16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLshort *s = (const GLshort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*4+0];
+ dst[i][GCOMP] = (GLfloat) s[i*4+1];
+ dst[i][BCOMP] = (GLfloat) s[i*4+2];
+ dst[i][ACOMP] = (GLfloat) s[i*4+3];
+ }
+}
+
+static void
+unpack_R_INT32(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLint *s = (const GLint *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i];
+ dst[i][GCOMP] = 0.0;
+ dst[i][BCOMP] = 0.0;
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RG_INT32(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLint *s = (const GLint *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*2+0];
+ dst[i][GCOMP] = (GLfloat) s[i*2+1];
+ dst[i][BCOMP] = 0.0;
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RGB_INT32(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLint *s = (const GLint *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*3+0];
+ dst[i][GCOMP] = (GLfloat) s[i*3+1];
+ dst[i][BCOMP] = (GLfloat) s[i*3+2];
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+
+static void
+unpack_RGBA_INT32(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLint *s = (const GLint *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*4+0];
+ dst[i][GCOMP] = (GLfloat) s[i*4+1];
+ dst[i][BCOMP] = (GLfloat) s[i*4+2];
+ dst[i][ACOMP] = (GLfloat) s[i*4+3];
+ }
+}
+
+static void
+unpack_R_UINT8(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLubyte *s = (const GLubyte *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i];
+ dst[i][GCOMP] = 0.0;
+ dst[i][BCOMP] = 0.0;
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RG_UINT8(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLubyte *s = (const GLubyte *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*2+0];
+ dst[i][GCOMP] = (GLfloat) s[i*2+1];
+ dst[i][BCOMP] = 0.0;
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RGB_UINT8(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLubyte *s = (const GLubyte *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*3+0];
+ dst[i][GCOMP] = (GLfloat) s[i*3+1];
+ dst[i][BCOMP] = (GLfloat) s[i*3+2];
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RGBA_UINT8(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLubyte *s = (const GLubyte *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*4+0];
+ dst[i][GCOMP] = (GLfloat) s[i*4+1];
+ dst[i][BCOMP] = (GLfloat) s[i*4+2];
+ dst[i][ACOMP] = (GLfloat) s[i*4+3];
+ }
+}
+
+static void
+unpack_R_UINT16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLushort *s = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i];
+ dst[i][GCOMP] = 0.0;
+ dst[i][BCOMP] = 0.0;
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RG_UINT16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLushort *s = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*2+0];
+ dst[i][GCOMP] = (GLfloat) s[i*2+1];
+ dst[i][BCOMP] = 0.0;
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RGB_UINT16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLushort *s = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*3+0];
+ dst[i][GCOMP] = (GLfloat) s[i*3+1];
+ dst[i][BCOMP] = (GLfloat) s[i*3+2];
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RGBA_UINT16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLushort *s = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*4+0];
+ dst[i][GCOMP] = (GLfloat) s[i*4+1];
+ dst[i][BCOMP] = (GLfloat) s[i*4+2];
+ dst[i][ACOMP] = (GLfloat) s[i*4+3];
+ }
+}
+
+static void
+unpack_R_UINT32(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLuint *s = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i];
+ dst[i][GCOMP] = 0.0;
+ dst[i][BCOMP] = 0.0;
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RG_UINT32(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLuint *s = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*2+0];
+ dst[i][GCOMP] = (GLfloat) s[i*2+1];
+ dst[i][BCOMP] = 0.0;
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RGB_UINT32(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLuint *s = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*3+0];
+ dst[i][GCOMP] = (GLfloat) s[i*3+1];
+ dst[i][BCOMP] = (GLfloat) s[i*3+2];
+ dst[i][ACOMP] = 1.0;
+ }
+}
+
+static void
+unpack_RGBA_UINT32(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLuint *s = (const GLuint *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = (GLfloat) s[i*4+0];
+ dst[i][GCOMP] = (GLfloat) s[i*4+1];
+ dst[i][BCOMP] = (GLfloat) s[i*4+2];
+ dst[i][ACOMP] = (GLfloat) s[i*4+3];
+ }
+}
+
+static void
+unpack_DUDV8(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLbyte *s = (const GLbyte *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = BYTE_TO_FLOAT(s[i*2+0]);
+ dst[i][GCOMP] = BYTE_TO_FLOAT(s[i*2+1]);
+ dst[i][BCOMP] = 0;
+ dst[i][ACOMP] = 0;
+ }
+}
+
+static void
+unpack_SIGNED_R8(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLbyte *s = ((const GLbyte *) src);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = BYTE_TO_FLOAT_TEX( s[i] );
+ dst[i][GCOMP] = 0.0F;
+ dst[i][BCOMP] = 0.0F;
+ dst[i][ACOMP] = 1.0F;
+ }
+}
+
+static void
+unpack_SIGNED_RG88_REV(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLushort *s = ((const GLushort *) src);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] & 0xff) );
+ dst[i][GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 8) );
+ dst[i][BCOMP] = 0.0F;
+ dst[i][ACOMP] = 1.0F;
+ }
+}
+
+static void
+unpack_SIGNED_RGBX8888(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLuint *s = ((const GLuint *) src);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 24) );
+ dst[i][GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 16) );
+ dst[i][BCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 8) );
+ dst[i][ACOMP] = 1.0f;
+ }
+}
+
+static void
+unpack_SIGNED_RGBA8888(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLuint *s = ((const GLuint *) src);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 24) );
+ dst[i][GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 16) );
+ dst[i][BCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 8) );
+ dst[i][ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] ) );
+ }
+}
+
+static void
+unpack_SIGNED_RGBA8888_REV(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLuint *s = ((const GLuint *) src);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] ) );
+ dst[i][GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 8) );
+ dst[i][BCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 16) );
+ dst[i][ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s[i] >> 24) );
+ }
+}
+
+static void
+unpack_SIGNED_R16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLshort *s = ((const GLshort *) src);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = SHORT_TO_FLOAT_TEX( s[i] );
+ dst[i][GCOMP] = 0.0F;
+ dst[i][BCOMP] = 0.0F;
+ dst[i][ACOMP] = 1.0F;
+ }
+}
+
+static void
+unpack_SIGNED_GR1616(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLuint *s = ((const GLuint *) src);
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = SHORT_TO_FLOAT_TEX( (GLshort) (s[i] & 0xffff) );
+ dst[i][GCOMP] = SHORT_TO_FLOAT_TEX( (GLshort) (s[i] >> 16) );
+ dst[i][BCOMP] = 0.0F;
+ dst[i][ACOMP] = 1.0F;
+ }
+}
+
+static void
+unpack_SIGNED_RGB_16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLshort *s = (const GLshort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = SHORT_TO_FLOAT_TEX( s[i*3+0] );
+ dst[i][GCOMP] = SHORT_TO_FLOAT_TEX( s[i*3+1] );
+ dst[i][BCOMP] = SHORT_TO_FLOAT_TEX( s[i*3+2] );
+ dst[i][ACOMP] = 1.0F;
+ }
+}
+
+static void
+unpack_SIGNED_RGBA_16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLshort *s = (const GLshort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = SHORT_TO_FLOAT_TEX( s[i*4+0] );
+ dst[i][GCOMP] = SHORT_TO_FLOAT_TEX( s[i*4+1] );
+ dst[i][BCOMP] = SHORT_TO_FLOAT_TEX( s[i*4+2] );
+ dst[i][ACOMP] = SHORT_TO_FLOAT_TEX( s[i*4+3] );
+ }
+}
+
+static void
+unpack_RGBA_16(const void *src, GLfloat dst[][4], GLuint n)
+{
+ const GLushort *s = (const GLushort *) src;
+ GLuint i;
+ for (i = 0; i < n; i++) {
+ dst[i][RCOMP] = USHORT_TO_FLOAT( s[i*4+0] );
+ dst[i][GCOMP] = USHORT_TO_FLOAT( s[i*4+1] );
+ dst[i][BCOMP] = USHORT_TO_FLOAT( s[i*4+2] );
+ dst[i][ACOMP] = USHORT_TO_FLOAT( s[i*4+3] );
+ }
+}
+
+static void
+unpack_RED_RGTC1(const void *src, GLfloat dst[][4], GLuint n)
+{
+ /* XXX to do */
+}
+
+static void
+unpack_SIGNED_RED_RGTC1(const void *src, GLfloat dst[][4], GLuint n)
+{
+ /* XXX to do */
+}
+
+static void
+unpack_RG_RGTC2(const void *src, GLfloat dst[][4], GLuint n)
+{
+ /* XXX to do */
+}
+
+static void
+unpack_SIGNED_RG_RGTC2(const void *src, GLfloat dst[][4], GLuint n)
+{
+ /* XXX to do */
+}
+
+static void
+unpack_L_LATC1(const void *src, GLfloat dst[][4], GLuint n)
+{
+ /* XXX to do */
+}
+
+static void
+unpack_SIGNED_L_LATC1(const void *src, GLfloat dst[][4], GLuint n)
+{
+ /* XXX to do */
+}
+
+static void
+unpack_LA_LATC2(const void *src, GLfloat dst[][4], GLuint n)
+{
+ /* XXX to do */
+}
+
+static void
+unpack_SIGNED_LA_LATC2(const void *src, GLfloat dst[][4], GLuint n)
+{
+ /* XXX to do */
+}
+
+static void