Fix R5G6B5 blend.
blend() unpacks to ARGB order.
Bug 20891368
Change-Id: I9a505631ee0751d4ef4b01b82c8617f155e95ca5
Reviewed-on: https://swiftshader-review.googlesource.com/3280
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/Main/FrameBuffer.cpp b/src/Main/FrameBuffer.cpp
index 3b1ba1b..37e9208 100644
--- a/src/Main/FrameBuffer.cpp
+++ b/src/Main/FrameBuffer.cpp
@@ -676,9 +676,9 @@
{
Int rgb(*Pointer<Short>(s));
rgb = 0xFF000000 |
- ((rgb & 0x001F) << 19) | ((rgb & 0x001C) << 14) |
+ ((rgb & 0xF800) << 8) | ((rgb & 0xE01F) << 3) |
((rgb & 0x07E0) << 5) | ((rgb & 0x0600) >> 1) |
- ((rgb & 0xF800) >> 8) | ((rgb & 0xE000) >> 13);
+ ((rgb & 0x001C) >> 2);
c2 = Unpack(As<Byte4>(rgb));
}
break;