summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-04-29 21:05:48 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-04-29 21:05:48 +0100
commitfbddc8097ce3a9d38a061105542875dbb9f909f7 (patch)
tree4b8c72dc13a2b69369844be010888a1dcade358d /src/gallium
parent7441f2e3ea77404064d65b604e1e525cacc453e9 (diff)
gallium: add pack for A4R4G4B4
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_pack_color.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h
index 7d4024e82c..f641329d18 100644
--- a/src/gallium/auxiliary/util/u_pack_color.h
+++ b/src/gallium/auxiliary/util/u_pack_color.h
@@ -95,6 +95,12 @@ util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a,
*d = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 3) | (b >> 3);
}
return;
+ case PIPE_FORMAT_A4R4G4B4_UNORM:
+ {
+ ushort *d = (ushort *) dest;
+ *d = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4);
+ }
+ return;
/* XXX lots more cases to add */
default:
debug_print_format("gallium: unhandled format in util_pack_color_ub()", format);
@@ -168,6 +174,12 @@ util_pack_color(const float rgba[4], enum pipe_format format, void *dest)
*d = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 3) | (b >> 3);
}
return;
+ case PIPE_FORMAT_A4R4G4B4_UNORM:
+ {
+ ushort *d = (ushort *) dest;
+ *d = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4);
+ }
+ return;
case PIPE_FORMAT_R32G32B32A32_FLOAT:
{
float *d = (float *) dest;