diff options
author | marha <marha@users.sourceforge.net> | 2011-11-28 08:33:39 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-11-28 08:33:39 +0100 |
commit | 7417e9a171736b5279881cd4381fb58c617a23d9 (patch) | |
tree | f5eefdba22232ed7549497c96e70f09ccf558988 /mesalib/src/mesa/main/format_unpack.c | |
parent | a0b4a1330be6a36ad095222d2ea83927cd33514d (diff) | |
download | vcxsrv-7417e9a171736b5279881cd4381fb58c617a23d9.tar.gz vcxsrv-7417e9a171736b5279881cd4381fb58c617a23d9.tar.bz2 vcxsrv-7417e9a171736b5279881cd4381fb58c617a23d9.zip |
mesa git update 28 nov 2011
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; |