diff options
author | Keith Whitwell <[email protected]> | 2008-04-29 20:42:35 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2008-04-29 20:48:15 +0100 |
commit | 7441f2e3ea77404064d65b604e1e525cacc453e9 (patch) | |
tree | 42923d3945720a696a31128a63edb8e779620507 | |
parent | 9bfe1a3d505733489f7583fe603b7d192f38fa8c (diff) |
gallium: add pack for A1R5B5G5
-rw-r--r-- | src/gallium/auxiliary/util/u_pack_color.h | 12 |
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 7e26b1642a2..7d4024e82cf 100644 --- a/src/gallium/auxiliary/util/u_pack_color.h +++ b/src/gallium/auxiliary/util/u_pack_color.h @@ -89,6 +89,12 @@ util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a, *d = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); } return; + case PIPE_FORMAT_A1R5G5B5_UNORM: + { + ushort *d = (ushort *) dest; + *d = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 3) | (b >> 3); + } + return; /* XXX lots more cases to add */ default: debug_print_format("gallium: unhandled format in util_pack_color_ub()", format); @@ -156,6 +162,12 @@ util_pack_color(const float rgba[4], enum pipe_format format, void *dest) *d = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); } return; + case PIPE_FORMAT_A1R5G5B5_UNORM: + { + ushort *d = (ushort *) dest; + *d = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 3) | (b >> 3); + } + return; case PIPE_FORMAT_R32G32B32A32_FLOAT: { float *d = (float *) dest; |