diff options
Diffstat (limited to 'src/mesa/main/format_utils.c')
-rw-r--r-- | src/mesa/main/format_utils.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c index 58a65adc4de..f87cbdf1155 100644 --- a/src/mesa/main/format_utils.c +++ b/src/mesa/main/format_utils.c @@ -652,8 +652,10 @@ _mesa_format_convert(void *void_dst, uint32_t dst_format, size_t dst_stride, } static const uint8_t map_identity[7] = { 0, 1, 2, 3, 4, 5, 6 }; +#if PIPE_ARCH_BIG_ENDIAN static const uint8_t map_3210[7] = { 3, 2, 1, 0, 4, 5, 6 }; static const uint8_t map_1032[7] = { 1, 0, 3, 2, 4, 5, 6 }; +#endif /** * Describes a format as an array format, if possible @@ -704,10 +706,18 @@ _mesa_format_to_array(mesa_format format, GLenum *type, int *num_components, endian = map_identity; break; case 2: - endian = _mesa_little_endian() ? map_identity : map_1032; +#if PIPE_ARCH_LITTLE_ENDIAN + endian = map_identity; +#else + endian = map_1032; +#endif break; case 4: - endian = _mesa_little_endian() ? map_identity : map_3210; +#if PIPE_ARCH_LITTLE_ENDIAN + endian = map_identity; +#else + endian = map_3210; +#endif break; default: endian = map_identity; @@ -725,7 +735,11 @@ _mesa_format_to_array(mesa_format format, GLenum *type, int *num_components, endian = map_identity; break; case 2: - endian = _mesa_little_endian() ? map_identity : map_1032; +#if PIPE_ARCH_LITTLE_ENDIAN + endian = map_identity; +#else + endian = map_1032; +#endif break; default: endian = map_identity; |