diff options
author | Jason Ekstrand <[email protected]> | 2014-08-22 20:32:27 -0700 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2015-01-12 11:20:27 +0100 |
commit | 96fe6191cb8c61ca5ae7c49f54db83f3b44ed126 (patch) | |
tree | 2fb827970e9532c18d18be63c5b7a60602612f96 /src/mesa/main/format_unpack.c | |
parent | 3e4669a8f3f61dab54faf1ae8512569bca1e54da (diff) |
mesa: Fix A1R5G5B5 packing/unpacking
As with B5G6R5, these have been left broken with comments saying they are.
Signed-off-by: Jason Ekstrand <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/format_unpack.c')
-rw-r--r-- | src/mesa/main/format_unpack.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c index 69c76d354c7..dfc5024dd48 100644 --- a/src/mesa/main/format_unpack.c +++ b/src/mesa/main/format_unpack.c @@ -2830,17 +2830,14 @@ unpack_ubyte_B5G5R5A1_UNORM(const void *src, GLubyte dst[][4], GLuint n) static void unpack_ubyte_A1R5G5B5_UNORM(const void *src, GLubyte dst[][4], GLuint n) { - /* Warning: this function does not match the current Mesa definition - * of MESA_FORMAT_A1R5G5B5_UNORM. - */ const GLushort *s = ((const GLushort *) src); GLuint i; for (i = 0; i < n; i++) { GLushort tmp = (s[i] << 8) | (s[i] >> 8); /* byteswap */ - dst[i][RCOMP] = EXPAND_5_8((tmp >> 10) & 0x1f); - dst[i][GCOMP] = EXPAND_5_8((tmp >> 5) & 0x1f); - dst[i][BCOMP] = EXPAND_5_8((tmp >> 0) & 0x1f); - dst[i][ACOMP] = EXPAND_1_8((tmp >> 15) & 0x01); + dst[i][RCOMP] = EXPAND_5_8((tmp >> 1) & 0x1f); + dst[i][GCOMP] = EXPAND_5_8((tmp >> 6) & 0x1f); + dst[i][BCOMP] = EXPAND_5_8((tmp >> 11) & 0x1f); + dst[i][ACOMP] = EXPAND_1_8((tmp ) & 0x01); } } |