diff options
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_texfetch.c | 3 | ||||
-rw-r--r-- | src/mesa/swrast/s_texfetch_tmp.h | 24 |
2 files changed, 27 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c index dfba19096f2..0f6da919dae 100644 --- a/src/mesa/swrast/s_texfetch.c +++ b/src/mesa/swrast/s_texfetch.c @@ -229,9 +229,12 @@ 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), diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h index f6888994aa7..7ff30f6b4ae 100644 --- a/src/mesa/swrast/s_texfetch_tmp.h +++ b/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) { |