diff options
author | Brian Paul <[email protected]> | 2014-03-06 10:56:27 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2014-03-06 18:17:14 -0700 |
commit | 0f0c16b238886f5bf08991109e88eb7bd507e1e6 (patch) | |
tree | bb83a56637221e62b89314d27881b8d5d0ec0d29 /src/mesa/swrast/s_texfetch_tmp.h | |
parent | 8d3f739383fbdf671752fdec707f1c2b9b2aa6a3 (diff) |
mesa: add MESA_FORMAT_R8G8B8A8_SRGB
To match PIPE_FORMAT_R8G8B8A8_SRGB.
v2: fix component name copy&paste bugs
Reviewed-by: José Fonseca <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/mesa/swrast/s_texfetch_tmp.h')
-rw-r--r-- | src/mesa/swrast/s_texfetch_tmp.h | 13 |
1 files changed, 13 insertions, 0 deletions
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 ) |