diff options
author | marha <marha@users.sourceforge.net> | 2011-11-28 08:38:39 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-11-28 08:38:39 +0100 |
commit | 22fb212bb84a69ab20a494aed1c197da1d2dbdf7 (patch) | |
tree | d11c21c9260bee0f56c34ee6e241671befd5257f /mesalib/src/mesa/main/format_unpack.c | |
parent | c1296df0ebe19a8e90fb7d7f0135d7034f16a76d (diff) | |
parent | 7417e9a171736b5279881cd4381fb58c617a23d9 (diff) | |
download | vcxsrv-22fb212bb84a69ab20a494aed1c197da1d2dbdf7.tar.gz vcxsrv-22fb212bb84a69ab20a494aed1c197da1d2dbdf7.tar.bz2 vcxsrv-22fb212bb84a69ab20a494aed1c197da1d2dbdf7.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/format_unpack.c')
-rw-r--r-- | mesalib/src/mesa/main/format_unpack.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/format_unpack.c b/mesalib/src/mesa/main/format_unpack.c index 080392f2b..2f051dfa4 100644 --- a/mesalib/src/mesa/main/format_unpack.c +++ b/mesalib/src/mesa/main/format_unpack.c @@ -113,6 +113,32 @@ unpack_ARGB8888_REV(const void *src, GLfloat dst[][4], GLuint n) } static void +unpack_RGBX8888(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = ((const GLuint *) src); + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = UBYTE_TO_FLOAT( (s[i] >> 24) ); + dst[i][GCOMP] = UBYTE_TO_FLOAT( (s[i] >> 16) & 0xff ); + dst[i][BCOMP] = UBYTE_TO_FLOAT( (s[i] >> 8) & 0xff ); + dst[i][ACOMP] = 1.0f; + } +} + +static void +unpack_RGBX8888_REV(const void *src, GLfloat dst[][4], GLuint n) +{ + const GLuint *s = ((const GLuint *) src); + GLuint i; + for (i = 0; i < n; i++) { + dst[i][RCOMP] = UBYTE_TO_FLOAT( (s[i] ) & 0xff ); + dst[i][GCOMP] = UBYTE_TO_FLOAT( (s[i] >> 8) & 0xff ); + dst[i][BCOMP] = UBYTE_TO_FLOAT( (s[i] >> 16) & 0xff ); + dst[i][ACOMP] = 1.0f; + } +} + +static void unpack_XRGB8888(const void *src, GLfloat dst[][4], GLuint n) { const GLuint *s = ((const GLuint *) src); @@ -1405,6 +1431,8 @@ get_unpack_rgba_function(gl_format format) table[MESA_FORMAT_RGBA8888_REV] = unpack_RGBA8888_REV; table[MESA_FORMAT_ARGB8888] = unpack_ARGB8888; table[MESA_FORMAT_ARGB8888_REV] = unpack_ARGB8888_REV; + table[MESA_FORMAT_RGBX8888] = unpack_RGBX8888; + table[MESA_FORMAT_RGBX8888_REV] = unpack_RGBX8888_REV; table[MESA_FORMAT_XRGB8888] = unpack_XRGB8888; table[MESA_FORMAT_XRGB8888_REV] = unpack_XRGB8888_REV; table[MESA_FORMAT_RGB888] = unpack_RGB888; |