gallium/util: use new util_vasprintf() function
[mesa.git] / src / gallium / auxiliary / util / u_format_s3tc.c
index fd628157b60cf0d6fba8e28f6197725d9140cb89..8c4f2150bef57240ec4aa9a1a1e7782ac72d413f 100644 (file)
 #include "u_math.h"
 #include "u_format.h"
 #include "u_format_s3tc.h"
-#include "u_format_srgb.h"
+#include "util/format_srgb.h"
 
 
 #if defined(_WIN32) || defined(WIN32)
 #define DXTN_LIBNAME "dxtn.dll"
+#elif defined(__CYGWIN__)
+#define DXTN_LIBNAME "cygtxc_dxtn.dll"
 #elif defined(__APPLE__)
 #define DXTN_LIBNAME "libtxc_dxtn.dylib"
 #else
@@ -111,7 +113,6 @@ util_format_s3tc_init(void)
    util_dl_proc fetch_2d_texel_rgba_dxt3;
    util_dl_proc fetch_2d_texel_rgba_dxt5;
    util_dl_proc tx_compress_dxtn;
-   char *force_s3tc_enable;
 
    if (!first_time)
       return;
@@ -122,15 +123,8 @@ util_format_s3tc_init(void)
 
    library = util_dl_open(DXTN_LIBNAME);
    if (!library) {
-      if ((force_s3tc_enable = getenv("force_s3tc_enable")) &&
-          !strcmp(force_s3tc_enable, "true")) {
-         debug_printf("couldn't open " DXTN_LIBNAME ", enabling DXTn due to "
-            "force_s3tc_enable=true environment variable\n");
-         util_format_s3tc_enabled = TRUE;
-      } else {
-         debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
-            "compression/decompression unavailable\n");
-      }
+      debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
+                   "compression/decompression unavailable\n");
       return;
    }
 
@@ -243,7 +237,7 @@ util_format_dxt5_rgba_fetch_rgba_float(float *dst, const uint8_t *src, unsigned
  * Block decompression.
  */
 
-static INLINE void
+static inline void
 util_format_dxtn_rgb_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
                                         const uint8_t *src_row, unsigned src_stride,
                                         unsigned width, unsigned height,
@@ -320,7 +314,7 @@ util_format_dxt5_rgba_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
                                            16, FALSE);
 }
 
-static INLINE void
+static inline void
 util_format_dxtn_rgb_unpack_rgba_float(float *dst_row, unsigned dst_stride,
                                        const uint8_t *src_row, unsigned src_stride,
                                        unsigned width, unsigned height,
@@ -408,7 +402,7 @@ util_format_dxt5_rgba_unpack_rgba_float(float *dst_row, unsigned dst_stride,
  * Block compression.
  */
 
-static INLINE void
+static inline void
 util_format_dxtn_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
                                   const uint8_t *src, unsigned src_stride,
                                   unsigned width, unsigned height,
@@ -486,7 +480,7 @@ util_format_dxt5_rgba_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
                                      16, FALSE);
 }
 
-static INLINE void
+static inline void
 util_format_dxtn_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
                                  const float *src, unsigned src_stride,
                                  unsigned width, unsigned height,