diff options
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_texfetch.c | 2 | ||||
-rw-r--r-- | src/mesa/swrast/s_texfetch_tmp.h | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c index 38d71caa38b..dfba19096f2 100644 --- a/src/mesa/swrast/s_texfetch.c +++ b/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), @@ -232,6 +233,7 @@ texfetch_funcs[] = FETCH_FUNCS(R8G8B8A8_SRGB), FETCH_FUNCS(R8G8B8X8_SRGB), FETCH_FUNCS(L8A8_SRGB), + FETCH_FUNCS(A8L8_SRGB), /* Array sRGB formats */ FETCH_FUNCS(L_SRGB8), diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h index 3923e2b6246..f6888994aa7 100644 --- a/src/mesa/swrast/s_texfetch_tmp.h +++ b/src/mesa/swrast/s_texfetch_tmp.h @@ -817,6 +817,18 @@ FETCH(L8A8_SRGB)(const struct swrast_texture_image *texImage, 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 */ +} + + +static void FETCH(RGBA_SINT8)(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel) { @@ -961,6 +973,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) { |