mesa/swrast: replace instances of _mesa_little_endian with preprocessor
authorDylan Baker <dylan@pnwbakers.com>
Thu, 6 Sep 2018 22:15:13 +0000 (15:15 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Tue, 5 Nov 2019 16:39:55 +0000 (16:39 +0000)
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
src/mesa/swrast/s_renderbuffer.c
src/mesa/swrast/s_triangle.c

index 8c97e4e11b480fd83a249254a8ea1a0a074e5866..2960a582c27242b50bbcd85ca24a56b7c172dd37 100644 (file)
@@ -76,14 +76,13 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
    case GL_RGBA4:
    case GL_RGB5_A1:
    case GL_RGBA8:
-#if 1
    case GL_RGB10_A2:
    case GL_RGBA12:
+#if PIPE_ARCH_LITTLE_ENDIAN
+      rb->Format = MESA_FORMAT_R8G8B8A8_UNORM;
+#else
+      rb->Format = MESA_FORMAT_A8B8G8R8_UNORM;
 #endif
-      if (_mesa_little_endian())
-         rb->Format = MESA_FORMAT_R8G8B8A8_UNORM;
-      else
-         rb->Format = MESA_FORMAT_A8B8G8R8_UNORM;
       break;
    case GL_RGBA16:
    case GL_RGBA16_SNORM:
index d80ab180bac2d2be0b5a8e72cd1672cd1adca9f7..cd0897d5e5c8e0a43830d6cfd8b97e414c859faa 100644 (file)
@@ -1108,7 +1108,7 @@ _swrast_choose_triangle( struct gl_context *ctx )
 #if CHAN_BITS != 8
                   USE(general_triangle);
 #else
-                  if (format == MESA_FORMAT_A8B8G8R8_UNORM && !_mesa_little_endian()) {
+                  if (format == MESA_FORMAT_A8B8G8R8_UNORM && !PIPE_ARCH_LITTLE_ENDIAN) {
                      /* We only handle RGBA8888 correctly on little endian
                       * in the optimized code above.
                       */