diff options
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_texfetch.c | 6 | ||||
-rw-r--r-- | src/mesa/swrast/s_texfetch_tmp.h | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c index 9c173a8b3dd..8ba75348ff7 100644 --- a/src/mesa/swrast/s_texfetch.c +++ b/src/mesa/swrast/s_texfetch.c @@ -437,6 +437,12 @@ texfetch_funcs[] = fetch_texel_3d_sargb8 }, { + MESA_FORMAT_R8G8B8A8_SRGB, + fetch_texel_1d_sabgr8, + fetch_texel_2d_sabgr8, + fetch_texel_3d_sabgr8 + }, + { MESA_FORMAT_L_SRGB8, fetch_texel_1d_sl8, fetch_texel_2d_sl8, diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h index 1db3adc7114..8821125a0e1 100644 --- a/src/mesa/swrast/s_texfetch_tmp.h +++ b/src/mesa/swrast/s_texfetch_tmp.h @@ -1015,6 +1015,19 @@ static void FETCH(sargb8)(const struct swrast_texture_image *texImage, +/* Fetch texel from 1D, 2D or 3D sabgr8 texture, return 4 GLfloats */ +static void FETCH(sabgr8)(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] = nonlinear_to_linear( (s ) & 0xff ); + texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); + texel[BCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */ +} + + + /* Fetch texel from 1D, 2D or 3D sl8 texture, return 4 GLfloats */ static void FETCH(sl8)(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) |