aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-09-21 18:11:28 +0200
committermarha <marha@users.sourceforge.net>2014-09-21 18:11:28 +0200
commit438af0c7d4bf60b408b259c88205ff2193195466 (patch)
tree46fd6465cb7431f64a3cb475a40587a261983af4 /mesalib/src/mesa/swrast
parentd0f70707dde032e662dbd5bc70df6ac915403abe (diff)
downloadvcxsrv-438af0c7d4bf60b408b259c88205ff2193195466.tar.gz
vcxsrv-438af0c7d4bf60b408b259c88205ff2193195466.tar.bz2
vcxsrv-438af0c7d4bf60b408b259c88205ff2193195466.zip
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
Diffstat (limited to 'mesalib/src/mesa/swrast')
-rw-r--r--mesalib/src/mesa/swrast/s_texfetch.c5
-rw-r--r--mesalib/src/mesa/swrast/s_texfetch_tmp.h54
2 files changed, 56 insertions, 3 deletions
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
@@ -769,6 +769,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)
{
@@ -793,6 +805,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 */
}
@@ -961,6 +997,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)
{