diff options
author | marha <marha@users.sourceforge.net> | 2014-10-01 20:12:35 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-10-01 20:12:35 +0200 |
commit | 19b4b68b35a047a83bd291ee8debac1adb0e946c (patch) | |
tree | d4d4520622ecf73fa0d076dc0bf517a1189b7d9f /mesalib/src/mesa/swrast | |
parent | 4e080e0165d18887e2a0fccd7f30cf20fd04b178 (diff) | |
parent | 438af0c7d4bf60b408b259c88205ff2193195466 (diff) | |
download | vcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.tar.gz vcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.tar.bz2 vcxsrv-19b4b68b35a047a83bd291ee8debac1adb0e946c.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mesa/main/macros.h
xorg-server/dix/registry.c
xorg-server/hw/kdrive/ephyr/ephyrinit.c
xorg-server/hw/xwin/Makefile.am
xorg-server/hw/xwin/glx/.gitignore
xorg-server/hw/xwin/glx/gen_gl_wrappers.py
xorg-server/hw/xwin/glx/indirect.c
xorg-server/hw/xwin/glx/winpriv.c
xorg-server/hw/xwin/winclipboardthread.c
xorg-server/hw/xwin/windisplay.c
xorg-server/hw/xwin/winmultiwindowwm.c
xorg-server/hw/xwin/winprefs.c
Diffstat (limited to 'mesalib/src/mesa/swrast')
-rw-r--r-- | mesalib/src/mesa/swrast/s_texfetch.c | 5 | ||||
-rw-r--r-- | mesalib/src/mesa/swrast/s_texfetch_tmp.h | 54 |
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) { |