i965: Add support for non-color render target write data to new FS backend.
[mesa.git] / src / mesa / drivers / dri / common / texmem.c
index c9c3324ed92df2ebb67cde9ba9e678f61635bb0b..895139b55b80e033bacb45b3f55523c5809114e4 100644 (file)
  * application.
  */
 
-#include "texmem.h"
-#include "main/simple_list.h"
 #include "main/imports.h"
 #include "main/macros.h"
-#include "main/texformat.h"
-
-#include <assert.h>
-
+#include "main/simple_list.h"
+#include "texmem.h"
 
 
 static unsigned dummy_swap_counter;
@@ -1302,8 +1298,8 @@ driCalculateTextureFirstLastLevel( driTextureObject * t )
 
 
 /**
- * \name DRI texture formats.  Pointers initialized to either the big- or
- * little-endian Mesa formats.
+ * \name DRI texture formats.  These vars are initialized to either the
+ * big- or little-endian Mesa formats.
  */
 /*@{*/
 gl_format _dri_texformat_rgba8888 = MESA_FORMAT_NONE;
@@ -1312,23 +1308,21 @@ gl_format _dri_texformat_rgb565 = MESA_FORMAT_NONE;
 gl_format _dri_texformat_argb4444 = MESA_FORMAT_NONE;
 gl_format _dri_texformat_argb1555 = MESA_FORMAT_NONE;
 gl_format _dri_texformat_al88 = MESA_FORMAT_NONE;
-gl_format _dri_texformat_a8 = MESA_FORMAT_NONE;
-gl_format _dri_texformat_ci8 = MESA_FORMAT_NONE;
-gl_format _dri_texformat_i8 = MESA_FORMAT_NONE;
-gl_format _dri_texformat_l8 = MESA_FORMAT_NONE;
+gl_format _dri_texformat_a8 = MESA_FORMAT_A8;
+gl_format _dri_texformat_ci8 = MESA_FORMAT_CI8;
+gl_format _dri_texformat_i8 = MESA_FORMAT_I8;
+gl_format _dri_texformat_l8 = MESA_FORMAT_L8;
 /*@}*/
 
 
 /**
- * Initialize little endian target, host byte order independent texture formats
+ * Initialize _dri_texformat_* vars according to whether we're on
+ * a big or little endian system.
  */
 void
 driInitTextureFormats(void)
 {
-   const GLuint ui = 1;
-   const GLubyte littleEndian = *((const GLubyte *) &ui);
-
-   if (littleEndian) {
+   if (_mesa_little_endian()) {
       _dri_texformat_rgba8888  = MESA_FORMAT_RGBA8888;
       _dri_texformat_argb8888  = MESA_FORMAT_ARGB8888;
       _dri_texformat_rgb565    = MESA_FORMAT_RGB565;