aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_texfetch_tmp.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-09 21:32:55 +0100
committermarha <marha@users.sourceforge.net>2014-03-09 21:32:55 +0100
commit3dd4b6420f686b0147d5b8136268cc63196e253b (patch)
tree2c81c3f7503dbcfb5b64fd95b40bb1c2204598ef /mesalib/src/mesa/swrast/s_texfetch_tmp.h
parent321c01267ae1c446f1bd22b642567fcafa016c02 (diff)
downloadvcxsrv-3dd4b6420f686b0147d5b8136268cc63196e253b.tar.gz
vcxsrv-3dd4b6420f686b0147d5b8136268cc63196e253b.tar.bz2
vcxsrv-3dd4b6420f686b0147d5b8136268cc63196e253b.zip
fontconfig mesa xserver git update 9 Mar 2014
xserver commit 1c61d38528a573caadee2468ee59ea558c822e09 fontconfig commit f8ccf379eb1092592ae0b65deb563c5491f69de9 mesa commit 897f40f25d21af678b1b67c1a68c4a6722d19983
Diffstat (limited to 'mesalib/src/mesa/swrast/s_texfetch_tmp.h')
-rw-r--r--mesalib/src/mesa/swrast/s_texfetch_tmp.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/mesalib/src/mesa/swrast/s_texfetch_tmp.h b/mesalib/src/mesa/swrast/s_texfetch_tmp.h
index 806f0fd1a..8821125a0 100644
--- a/mesalib/src/mesa/swrast/s_texfetch_tmp.h
+++ b/mesalib/src/mesa/swrast/s_texfetch_tmp.h
@@ -611,10 +611,10 @@ static void FETCH(f_argb4444_rev)( const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- texel[RCOMP] = ((s ) & 0xf) * (1.0F / 15.0F);
- texel[GCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F);
- texel[BCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F);
- texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F);
+ texel[RCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F);
+ texel[GCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F);
+ texel[BCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F);
+ texel[ACOMP] = ((s ) & 0xf) * (1.0F / 15.0F);
}
@@ -1015,6 +1015,19 @@ static void FETCH(sargb8)(const struct swrast_texture_image *texImage,
+/* Fetch texel from 1D, 2D or 3D sabgr8 texture, return 4 GLfloats */
+static void FETCH(sabgr8)(const struct swrast_texture_image *texImage,
+ GLint i, GLint j, GLint k, GLfloat *texel )
+{
+ const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
+ texel[RCOMP] = nonlinear_to_linear( (s ) & 0xff );
+ texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff );
+ texel[BCOMP] = nonlinear_to_linear( (s >> 16) & 0xff );
+ texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */
+}
+
+
+
/* Fetch texel from 1D, 2D or 3D sl8 texture, return 4 GLfloats */
static void FETCH(sl8)(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )