Fix invalid channel order in tcuTextureUtil.
authorJarkko Pöyry <jpoyry@google.com>
Thu, 19 Mar 2015 21:58:31 +0000 (14:58 -0700)
committerJarkko Pöyry <jpoyry@google.com>
Thu, 19 Mar 2015 22:08:36 +0000 (15:08 -0700)
- tcuTextureUtil stored channel bit depths of combined formats in
  swizzled form. Reorder combined formats so that depth of the first
  channel is in the first component and depth of the second channel is
  in the second, not 4th, component. Since these values are swizzled
  using the channel read swizzle when queried, this change prevents
  combined formats from being swizzled two times.

Bug: 19846703
Change-Id: I2afd47ae2ecb9f93f982ef2c9dbd24f5223bf172

framework/common/tcuTextureUtil.cpp

index 73ebc0f..d883f53 100644 (file)
@@ -334,12 +334,12 @@ static IVec4 getChannelBitDepth (TextureFormat::ChannelType channelType)
                case TextureFormat::UNSIGNED_INT16:                                     return IVec4(16);
                case TextureFormat::UNSIGNED_INT32:                                     return IVec4(32);
                case TextureFormat::UNSIGNED_INT_1010102_REV:           return IVec4(10,10,10,2);
-               case TextureFormat::UNSIGNED_INT_24_8:                          return IVec4(24,0,0,8);
+               case TextureFormat::UNSIGNED_INT_24_8:                          return IVec4(24,8,0,0);
                case TextureFormat::HALF_FLOAT:                                         return IVec4(16);
                case TextureFormat::FLOAT:                                                      return IVec4(32);
                case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV:       return IVec4(11,11,10,0);
                case TextureFormat::UNSIGNED_INT_999_E5_REV:            return IVec4(9,9,9,0);
-               case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV:        return IVec4(32,0,0,8);
+               case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV:        return IVec4(32,8,0,0);
                default:
                        DE_ASSERT(false);
                        return IVec4(0);
@@ -396,7 +396,7 @@ static IVec4 getChannelMantissaBitDepth (TextureFormat::ChannelType channelType)
                case TextureFormat::HALF_FLOAT:                                         return IVec4(10);
                case TextureFormat::FLOAT:                                                      return IVec4(23);
                case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV:       return IVec4(6,6,5,0);
-               case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV:        return IVec4(23,0,0,8);
+               case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV:        return IVec4(23,8,0,0);
                default:
                        DE_ASSERT(false);
                        return IVec4(0);