aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texcompress_fxt1.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-12-17 11:51:13 +0100
committermarha <marha@users.sourceforge.net>2012-12-17 11:51:13 +0100
commit840c8745518b92303d40f6834e9c616587242231 (patch)
tree097a30453fb59b6a88708c3f576e824e8f237c52 /mesalib/src/mesa/main/texcompress_fxt1.c
parentb395c3c85251d4e8761704d8e3a3c9f9fa5b45cc (diff)
downloadvcxsrv-840c8745518b92303d40f6834e9c616587242231.tar.gz
vcxsrv-840c8745518b92303d40f6834e9c616587242231.tar.bz2
vcxsrv-840c8745518b92303d40f6834e9c616587242231.zip
libXft pixman mesa git update 17 dec 2012
libXft: 835cd2a6cb4aa8f89e6e7dead66483643a6e7ee8 pixman: 526dc06e5694172abf979c03a5cf530207fe2d27 mesa: 1358f3a905448f6fb546aba951e317f743a83c76
Diffstat (limited to 'mesalib/src/mesa/main/texcompress_fxt1.c')
-rw-r--r--mesalib/src/mesa/main/texcompress_fxt1.c74
1 files changed, 42 insertions, 32 deletions
diff --git a/mesalib/src/mesa/main/texcompress_fxt1.c b/mesalib/src/mesa/main/texcompress_fxt1.c
index eeed78891..f7254f92e 100644
--- a/mesalib/src/mesa/main/texcompress_fxt1.c
+++ b/mesalib/src/mesa/main/texcompress_fxt1.c
@@ -39,7 +39,6 @@
#include "texcompress.h"
#include "texcompress_fxt1.h"
#include "texstore.h"
-#include "swrast/s_context.h"
static void
@@ -151,37 +150,6 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
}
-void
-_mesa_fetch_texel_2d_f_rgba_fxt1( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- /* just sample as GLubyte and convert to float here */
- GLubyte rgba[4];
- (void) k;
- fxt1_decode_1(texImage->Map, texImage->RowStride, i, j, rgba);
- texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
-}
-
-
-void
-_mesa_fetch_texel_2d_f_rgb_fxt1( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLfloat *texel )
-{
- /* just sample as GLubyte and convert to float here */
- GLubyte rgba[4];
- (void) k;
- fxt1_decode_1(texImage->Map, texImage->RowStride, i, j, rgba);
- texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = 1.0F;
-}
-
-
-
/***************************************************************************\
* FXT1 encoder
*
@@ -1643,3 +1611,45 @@ fxt1_decode_1 (const void *texture, GLint stride, /* in pixels */
decode_1[mode](code, t, rgba);
}
+
+
+
+
+static void
+fetch_rgb_fxt1(const GLubyte *map, const GLuint imageOffsets[],
+ GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel)
+{
+ GLubyte rgba[4];
+ fxt1_decode_1(map, rowStride, i, j, rgba);
+ texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = 1.0F;
+}
+
+
+static void
+fetch_rgba_fxt1(const GLubyte *map, const GLuint imageOffsets[],
+ GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel)
+{
+ GLubyte rgba[4];
+ fxt1_decode_1(map, rowStride, i, j, rgba);
+ texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
+}
+
+
+compressed_fetch_func
+_mesa_get_fxt_fetch_func(gl_format format)
+{
+ switch (format) {
+ case MESA_FORMAT_RGB_FXT1:
+ return fetch_rgb_fxt1;
+ case MESA_FORMAT_RGBA_FXT1:
+ return fetch_rgba_fxt1;
+ default:
+ return NULL;
+ }
+}