summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-04-22 23:13:47 -0700
committerKenneth Graunke <kenneth@whitecape.org>2013-04-23 22:12:58 -0700
commit531be501de7530ede3c0ea7a1d94516df37e4ae5 (patch)
tree48a1f96b21dbc4f99ec6ce740a2a4908d71d3fb1
parentb1fded54c959c38f0e3fc3d8500250b01ccaaa3a (diff)
mesa: Add an unpack function for ARGB2101010_UINT.
v2: Remove extra parenthesis (suggested by Brian). NOTE: This is a candidate for stable branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63569 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--src/mesa/main/format_unpack.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index 03221c307db..9d565ccf1b3 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -611,6 +611,20 @@ unpack_ARGB2101010(const void *src, GLfloat dst[][4], GLuint n)
static void
+unpack_ARGB2101010_UINT(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] = (GLfloat)((s[i] >> 20) & 0x3ff);
+ dst[i][GCOMP] = (GLfloat)((s[i] >> 10) & 0x3ff);
+ dst[i][BCOMP] = (GLfloat)((s[i] >> 0) & 0x3ff);
+ dst[i][ACOMP] = (GLfloat)((s[i] >> 30) & 0x03);
+ }
+}
+
+
+static void
unpack_ABGR2101010_UINT(const void *src, GLfloat dst[][4], GLuint n)
{
const GLuint *s = ((const GLuint *) src);
@@ -1771,6 +1785,7 @@ get_unpack_rgba_function(gl_format format)
table[MESA_FORMAT_GR1616] = unpack_GR1616;
table[MESA_FORMAT_RG1616] = unpack_RG1616;
table[MESA_FORMAT_ARGB2101010] = unpack_ARGB2101010;
+ table[MESA_FORMAT_ARGB2101010_UINT] = unpack_ARGB2101010_UINT;
table[MESA_FORMAT_ABGR2101010_UINT] = unpack_ABGR2101010_UINT;
table[MESA_FORMAT_Z24_S8] = unpack_Z24_S8;
table[MESA_FORMAT_S8_Z24] = unpack_S8_Z24;