mesa/formats: Only do byteswapping for packed formats
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 8 Aug 2015 16:00:21 +0000 (09:00 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 12 Aug 2015 15:28:31 +0000 (08:28 -0700)
Reviewed-by: Iago Toral <itoral@igalia.com>
Cc: "10.6 10.5" <mesa-stable@lists.freedesktop.org>
src/mesa/main/formats.c

index baeb1bfe5deda82a6a16de6d51e582eb1ca54376..d927073b0dc8c65730b9ecea2998b9ceb146fe5a 100644 (file)
@@ -372,10 +372,10 @@ uint32_t
 _mesa_format_to_array_format(mesa_format format)
 {
    const struct gl_format_info *info = _mesa_get_format_info(format);
-   if (_mesa_little_endian())
-      return info->ArrayFormat;
-   else
+   if (!_mesa_little_endian() && info->Layout == MESA_FORMAT_LAYOUT_PACKED)
       return _mesa_array_format_flip_channels(info->ArrayFormat);
+   else
+      return info->ArrayFormat;
 }
 
 static struct hash_table *format_array_format_table;