diff options
author | Roland Scheidegger <[email protected]> | 2009-03-27 21:59:33 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2009-03-28 02:03:45 +0100 |
commit | bb386a1ecae6d7f805af44df463b0e4d661eef85 (patch) | |
tree | d5e67b93a63b949b913da9df993d696ef7366ef4 /src/mesa/main/texformat_tmp.h | |
parent | 7d00ba195c4d8f58eec8e2ab553225a7e17ad656 (diff) |
mesa: add _rev signed rgba texture format
Diffstat (limited to 'src/mesa/main/texformat_tmp.h')
-rw-r--r-- | src/mesa/main/texformat_tmp.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 604b1a744cb..ae57baf9222 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -1321,7 +1321,7 @@ static void FETCH(dudv8)(const struct gl_texture_image *texImage, texel[ACOMP] = 0; } -/* MESA_FORMAT_SIGNED_ARGB8888 ***********************************************/ +/* MESA_FORMAT_SIGNED_RGBA8888 ***********************************************/ static void FETCH(signed_rgba8888)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) @@ -1343,6 +1343,27 @@ static void store_texel_signed_rgba8888(struct gl_texture_image *texImage, } #endif +static void FETCH(signed_rgba8888_rev)( 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] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); + texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); + texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); + texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); +} + +#if DIM == 3 +static void store_texel_signed_rgba8888_rev(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_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + /* MESA_FORMAT_YCBCR *********************************************************/ |