From f73a9c6586b631d3f6cddb923b0611f9ff7a70ba Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 6 Sep 2018 15:15:13 -0700 Subject: [PATCH] mesa/swrast: replace instances of _mesa_little_endian with preprocessor Reviewed-by: Eric Engestrom --- src/mesa/swrast/s_renderbuffer.c | 9 ++++----- src/mesa/swrast/s_triangle.c | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mesa/swrast/s_renderbuffer.c b/src/mesa/swrast/s_renderbuffer.c index 8c97e4e11b4..2960a582c27 100644 --- a/src/mesa/swrast/s_renderbuffer.c +++ b/src/mesa/swrast/s_renderbuffer.c @@ -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: diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index d80ab180bac..cd0897d5e5c 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -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. */ -- 2.30.2