[Mesa-dev] [PATCH 09/28] mesa/swrast: replace instances of _mesa_little_endian with preprocessor
Dylan Baker
dylan at pnwbakers.com
Fri Nov 9 18:40:02 UTC 2018
---
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..ab4932728a9 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:
+#ifdef 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.19.1
More information about the mesa-dev
mailing list