diff options
author | Brian Paul <[email protected]> | 2009-10-06 22:30:01 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-10-06 22:30:01 -0600 |
commit | 74d61d03b54d72217d463c248468cdcd09320efc (patch) | |
tree | 18bb58871ca7c7b3e5f672bf58c8e183bb23165d /src/mesa/main/texfetch_tmp.h | |
parent | c5b725489243e6a94ca5e31306cdfa93619bd200 (diff) |
mesa: added MESA_FORMAT_XRGB8888
Diffstat (limited to 'src/mesa/main/texfetch_tmp.h')
-rw-r--r-- | src/mesa/main/texfetch_tmp.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 43030c29853..27434946ec8 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -535,6 +535,30 @@ static void store_texel_argb8888_rev(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_XRGB8888 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D xrgb8888 texture, return 4 GLchans */ +static void FETCH(f_xrgb8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); + texel[ACOMP] = 1.0f; +} + +#if DIM == 3 +static void store_texel_xrgb8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(0xff, rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + /* MESA_FORMAT_RGB888 ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */ |