Use endianness test function provided by mesa.
authorJerome Glisse <glisse@freedesktop.org>
Sun, 15 Oct 2006 18:22:28 +0000 (18:22 +0000)
committerJerome Glisse <glisse@freedesktop.org>
Sun, 15 Oct 2006 18:22:28 +0000 (18:22 +0000)
Use the _mesa_little_endian helper function insted
of the MESA_BIG_ENDIAN flag. There is still place
using this flag but we need to find how to submit
16bits elements on big endian computer.

src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_texstate.c

index bac1bef9681255cbc3bb99257d3d16aab37b81f6..29ffa7a017471eb66262424236536ffd3b26787b 100644 (file)
@@ -1910,11 +1910,10 @@ void r300ResetHwState(r300ContextPtr r300)
 
        r300->hw.unk2134.cmd[1] = 0x00FFFFFF;
        r300->hw.unk2134.cmd[2] = 0x00000000;
-#ifdef MESA_BIG_ENDIAN
-       r300->hw.unk2140.cmd[1] = 0x00000002;
-#else
-       r300->hw.unk2140.cmd[1] = 0x00000000;
-#endif
+       if (_mesa_little_endian())
+               r300->hw.unk2140.cmd[1] = 0x00000000;
+       else
+               r300->hw.unk2140.cmd[1] = 0x00000002;
 
 #if 0 /* Done in setup routing */
        ((drm_r300_cmd_header_t*)r300->hw.vir[0].cmd)->packet0.count = 1;
index 791427a6abee4c1fb529a8324584e466d01c2f45..1d78918a2b011d93df9429c350eefa9506d3ced4 100644 (file)
@@ -172,18 +172,16 @@ static void r300SetTexImages(r300ContextPtr rmesa,
        GLint numLevels;
        GLint log2Width, log2Height, log2Depth;
        const GLuint ui = 1;
-       const GLubyte littleEndian = *((const GLubyte *) &ui);
 
        /* Set the hardware texture format
         */
        if (VALID_FORMAT(baseImage->TexFormat->MesaFormat)) {
-               if (littleEndian) {
+               if (_mesa_little_endian()) {
                        t->format =
                            tx_table_le[baseImage->TexFormat->MesaFormat].format;
                        t->filter |=
                            tx_table_le[baseImage->TexFormat->MesaFormat].filter;
-               }
-               else {
+               } else {
                        t->format =
                            tx_table_be[baseImage->TexFormat->MesaFormat].format;
                        t->filter |=