mesa: Remove unnecessary header.
[mesa.git] / src / mesa / main / texfetch_tmp.h
index 093e0abc49519a235c2339f49a673642ddb81f8b..e6772c89f36ae17f5dfbc036d9da1a0d9b1d7aa2 100644 (file)
@@ -559,6 +559,30 @@ static void store_texel_xrgb8888(struct gl_texture_image *texImage,
 #endif
 
 
+/* MESA_FORMAT_XRGB8888_REV **************************************************/
+
+/* Fetch texel from 1D, 2D or 3D xrgb8888_rev texture, return 4 GLfloats */
+static void FETCH(f_xrgb8888_rev)( const struct gl_texture_image *texImage,
+                                   GLint i, GLint j, GLint k, GLfloat *texel )
+{
+   const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+   texel[RCOMP] = UBYTE_TO_FLOAT( (s >>  8) & 0xff );
+   texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff );
+   texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24)        );
+   texel[ACOMP] = 1.0f;
+}
+
+#if DIM == 3
+static void store_texel_xrgb8888_rev(struct gl_texture_image *texImage,
+                                     GLint i, GLint j, GLint k, const void *texel)
+{
+   const GLubyte *rgba = (const GLubyte *) texel;
+   GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+   *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], 0xff);
+}
+#endif
+
+
 /* MESA_FORMAT_RGB888 ********************************************************/
 
 /* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */
@@ -840,7 +864,7 @@ static void store_texel_al88_rev(struct gl_texture_image *texImage,
 static void FETCH(f_al1616)( const struct gl_texture_image *texImage,
                             GLint i, GLint j, GLint k, GLfloat *texel )
 {
-   const GLuint s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
+   const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
    texel[RCOMP] =
    texel[GCOMP] =
    texel[BCOMP] = USHORT_TO_FLOAT( s & 0xffff );
@@ -852,7 +876,7 @@ static void store_texel_al1616(struct gl_texture_image *texImage,
                              GLint i, GLint j, GLint k, const void *texel)
 {
    const GLushort *rgba = (const GLushort *) texel;
-   GLuint *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
+   GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
    *dst = PACK_COLOR_1616(rgba[ACOMP], rgba[RCOMP]);
 }
 #endif