From 840c8745518b92303d40f6834e9c616587242231 Mon Sep 17 00:00:00 2001 From: marha Date: Mon, 17 Dec 2012 11:51:13 +0100 Subject: libXft pixman mesa git update 17 dec 2012 libXft: 835cd2a6cb4aa8f89e6e7dead66483643a6e7ee8 pixman: 526dc06e5694172abf979c03a5cf530207fe2d27 mesa: 1358f3a905448f6fb546aba951e317f743a83c76 --- mesalib/src/mesa/main/texcompress_fxt1.c | 74 ++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 32 deletions(-) (limited to 'mesalib/src/mesa/main/texcompress_fxt1.c') 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; + } +} -- cgit v1.2.3