}
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
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;
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;
_mesa_format_to_array_format(mesa_format format)
{
const struct mesa_format_info *info = _mesa_get_format_info(format);
- if (info->ArrayFormat && !_mesa_little_endian() &&
- info->Layout == MESA_FORMAT_LAYOUT_PACKED)
+#if PIPE_ARCH_BIG_ENDIAN
+ if (info->ArrayFormat && info->Layout == MESA_FORMAT_LAYOUT_PACKED)
return _mesa_array_format_flip_channels(info->ArrayFormat);
else
+#endif
return info->ArrayFormat;
}
if (!info->ArrayFormat)
continue;
- if (_mesa_little_endian()) {
+#if PIPE_ARCH_LITTLE_ENDIAN
array_format = info->ArrayFormat;
- } else {
+#else
array_format = _mesa_array_format_flip_channels(info->ArrayFormat);
- }
+#endif
/* This can happen and does for some of the BGR formats. Let's take
* the first one in the list.
tempImageSlices[0] = (GLubyte *) tempImage;
_mesa_texstore(ctx, dims,
baseInternalFormat,
- _mesa_little_endian() ? MESA_FORMAT_R8G8B8A8_UNORM
- : MESA_FORMAT_A8B8G8R8_UNORM,
+#if PIPE_ARCH_LITTLE_ENDIAN
+ MESA_FORMAT_R8G8B8A8_UNORM,
+#else
+ MESA_FORMAT_A8B8G8R8_UNORM,
+#endif
rgbaRowStride, tempImageSlices,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
tempImageSlices[0] = (GLubyte *) tempImage;
_mesa_texstore(ctx, dims,
baseInternalFormat,
- _mesa_little_endian() ? MESA_FORMAT_R8G8B8A8_UNORM
- : MESA_FORMAT_A8B8G8R8_UNORM,
+#if PIPE_ARCH_LITTLE_ENDIAN
+ MESA_FORMAT_R8G8B8A8_UNORM,
+#else
+ MESA_FORMAT_A8B8G8R8_UNORM,
+#endif
rgbaRowStride, tempImageSlices,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
tempImageSlices[0] = (GLubyte *) tempImage;
_mesa_texstore(ctx, dims,
baseInternalFormat,
- _mesa_little_endian() ? MESA_FORMAT_R8G8B8A8_UNORM
- : MESA_FORMAT_A8B8G8R8_UNORM,
+#if PIPE_ARCH_LITTLE_ENDIAN
+ MESA_FORMAT_R8G8B8A8_UNORM,
+#else
+ MESA_FORMAT_A8B8G8R8_UNORM,
+#endif
rgbaRowStride, tempImageSlices,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
tempImageSlices[0] = (GLubyte *) tempImage;
_mesa_texstore(ctx, dims,
baseInternalFormat,
- _mesa_little_endian() ? MESA_FORMAT_R8G8B8A8_UNORM
- : MESA_FORMAT_A8B8G8R8_UNORM,
+#if PIPE_ARCH_LITTLE_ENDIAN
+ MESA_FORMAT_R8G8B8A8_UNORM,
+#else
+ MESA_FORMAT_A8B8G8R8_UNORM,
+#endif
rgbaRowStride, tempImageSlices,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
tempImageSlices[0] = (GLubyte *) tempImage;
_mesa_texstore(ctx, dims,
baseInternalFormat,
- _mesa_little_endian() ? MESA_FORMAT_R8G8B8A8_UNORM
- : MESA_FORMAT_A8B8G8R8_UNORM,
+#if PIPE_ARCH_LITTLE_ENDIAN
+ MESA_FORMAT_R8G8B8A8_UNORM,
+#else
+ MESA_FORMAT_A8B8G8R8_UNORM,
+#endif
rgbaRowStride, tempImageSlices,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
static GLboolean
_mesa_texstore_ycbcr(TEXSTORE_PARAMS)
{
- const GLboolean littleEndian = _mesa_little_endian();
-
(void) ctx; (void) dims; (void) baseInternalFormat;
assert((dstFormat == MESA_FORMAT_YCBCR) ||
if (srcPacking->SwapBytes ^
(srcType == GL_UNSIGNED_SHORT_8_8_REV_MESA) ^
(dstFormat == MESA_FORMAT_YCBCR_REV) ^
- !littleEndian) {
+ !PIPE_ARCH_LITTLE_ENDIAN) {
GLint img, row;
for (img = 0; img < srcDepth; img++) {
GLubyte *dstRow = dstSlices[img];