From 438af0c7d4bf60b408b259c88205ff2193195466 Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 21 Sep 2014 18:11:28 +0200 Subject: libxtrans xkeyboard-config xserver mesa plink glproto git update 21 Sep 2014 plink revision 10233 xserver commit 28337cb14e4347e1dd7936c5393a22e042866687 xkeyboard-config commit 48e1c0b351b6711edc0f167cbb81e4424b75291a glproto commit bd3d751e1eb17efb39f65093271bb4ac071aa9e0 libxtrans commit fb7f198c88e97d22c8c89e76e9cd06b2b2720a96 mesa commit 4eb2bbefd2bf0359aff7ebbb8e931a1c7833606f --- mesalib/src/mesa/swrast/s_texfetch.c | 5 +++ mesalib/src/mesa/swrast/s_texfetch_tmp.h | 54 ++++++++++++++++++++++++++++++-- 2 files changed, 56 insertions(+), 3 deletions(-) (limited to 'mesalib/src/mesa/swrast') diff --git a/mesalib/src/mesa/swrast/s_texfetch.c b/mesalib/src/mesa/swrast/s_texfetch.c index 38d71caa3..0f6da919d 100644 --- a/mesalib/src/mesa/swrast/s_texfetch.c +++ b/mesalib/src/mesa/swrast/s_texfetch.c @@ -210,6 +210,7 @@ texfetch_funcs[] = FETCH_FUNCS(R8G8_SNORM), FETCH_NULL(G8R8_SNORM), FETCH_FUNCS(L8A8_SNORM), + FETCH_FUNCS(A8L8_SNORM), /* Array signed/normalized formats */ FETCH_FUNCS(A_SNORM8), @@ -228,10 +229,14 @@ texfetch_funcs[] = /* Packed sRGB formats */ FETCH_FUNCS(A8B8G8R8_SRGB), FETCH_FUNCS(B8G8R8A8_SRGB), + FETCH_FUNCS(A8R8G8B8_SRGB), FETCH_NULL(B8G8R8X8_SRGB), + FETCH_NULL(X8R8G8B8_SRGB), FETCH_FUNCS(R8G8B8A8_SRGB), FETCH_FUNCS(R8G8B8X8_SRGB), + FETCH_FUNCS(X8B8G8R8_SRGB), FETCH_FUNCS(L8A8_SRGB), + FETCH_FUNCS(A8L8_SRGB), /* Array sRGB formats */ FETCH_FUNCS(L_SRGB8), diff --git a/mesalib/src/mesa/swrast/s_texfetch_tmp.h b/mesalib/src/mesa/swrast/s_texfetch_tmp.h index 72037ec00..7ff30f6b4 100644 --- a/mesalib/src/mesa/swrast/s_texfetch_tmp.h +++ b/mesalib/src/mesa/swrast/s_texfetch_tmp.h @@ -768,6 +768,18 @@ FETCH(B8G8R8A8_SRGB)(const struct swrast_texture_image *texImage, } +static void +FETCH(A8R8G8B8_SRGB)(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] = util_format_srgb_8unorm_to_linear_float( (s >> 8) & 0xff ); + texel[GCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 16) & 0xff ); + texel[BCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 24) ); + texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff ); /* linear! */ +} + + static void FETCH(R8G8B8A8_SRGB)(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel) @@ -792,6 +804,18 @@ FETCH(R8G8B8X8_SRGB)(const struct swrast_texture_image *texImage, } +static void +FETCH(X8B8G8R8_SRGB)(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] = util_format_srgb_8unorm_to_linear_float( (s >> 24) ); + texel[GCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 16) & 0xff ); + texel[BCOMP] = util_format_srgb_8unorm_to_linear_float( (s >> 8) & 0xff ); + texel[ACOMP] = 1.0f; +} + + static void FETCH(L_SRGB8)(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel) @@ -808,11 +832,23 @@ static void FETCH(L8A8_SRGB)(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel) { - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = - texel[BCOMP] = util_format_srgb_8unorm_to_linear_float(src[0]); - texel[ACOMP] = UBYTE_TO_FLOAT(src[1]); /* linear */ + texel[BCOMP] = util_format_srgb_8unorm_to_linear_float(s & 0xff); + texel[ACOMP] = UBYTE_TO_FLOAT(s >> 8); /* linear */ +} + + +static void +FETCH(A8L8_SRGB)(const struct swrast_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) +{ + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 2); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = util_format_srgb_8unorm_to_linear_float(s >> 8); + texel[ACOMP] = UBYTE_TO_FLOAT(s & 0xff); /* linear */ } @@ -960,6 +996,18 @@ FETCH(L8A8_SNORM)(const struct swrast_texture_image *texImage, } +static void +FETCH(A8L8_SNORM)(const struct swrast_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) +{ + const GLushort s = *TEXEL_ADDR(GLshort, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 8) ); + texel[ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s & 0xff) ); +} + + static void FETCH(X8B8G8R8_SNORM)(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel) -- cgit v1.2.3