Fix broken toRGBAMasked.
authorJarkko Pöyry <jpoyry@google.com>
Thu, 2 Apr 2015 18:23:31 +0000 (11:23 -0700)
committerJarkko Poyry <jpoyry@google.com>
Thu, 2 Apr 2015 18:39:01 +0000 (18:39 +0000)
- toRGBAMasked returned incorrect default value for alpha channel when
  the channel was not present. (i.e. rgb565, rgb888 formats).

Bug: 20048027
Change-Id: I7fec467491a31e017b32737e6609ad4379c4091e

modules/glshared/glsTextureTestUtil.hpp

index e938cbb..6225efb 100644 (file)
@@ -253,7 +253,7 @@ inline tcu::RGBA toRGBAMasked (const tcu::Vec4& v, deUint8 mask)
        return tcu::RGBA((mask&tcu::RGBA::RED_MASK)             ? tcu::floatToU8(v.x()) : 0,
                                         (mask&tcu::RGBA::GREEN_MASK)   ? tcu::floatToU8(v.y()) : 0,
                                         (mask&tcu::RGBA::BLUE_MASK)    ? tcu::floatToU8(v.z()) : 0,
-                                        (mask&tcu::RGBA::ALPHA_MASK)   ? tcu::floatToU8(v.w()) : 0);
+                                        (mask&tcu::RGBA::ALPHA_MASK)   ? tcu::floatToU8(v.w()) : 0xFF); //!< \note Alpha defaults to full saturation when reading masked format
 }
 
 inline tcu::Vec4 toVec4 (const tcu::RGBA& c)