From: Brian Paul Date: Tue, 4 Jan 2011 00:14:21 +0000 (-0700) Subject: mesa: fix AL44 texture fetch function nybble -> float conversion X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7bd2c5d1f98d0cfcf896a58c3d66713165f6bedd;p=mesa.git mesa: fix AL44 texture fetch function nybble -> float conversion Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32804 --- diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 2de41f31d0e..9d57ad7679b 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -899,8 +899,8 @@ static void FETCH(f_al44)( const struct gl_texture_image *texImage, const GLubyte s = *TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_FLOAT( (s & 0x0f) << 4 ); - texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xf0 ); + texel[BCOMP] = (s & 0xf) * (1.0F / 15.0F); + texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); } #if DIM == 3