util: enable S3TC support when the force_s3tc_enable env var is set to "true"
authorBryan Cain <bryancain3@gmail.com>
Wed, 20 Jul 2011 22:35:22 +0000 (17:35 -0500)
committerBryan Cain <bryancain3@gmail.com>
Tue, 26 Jul 2011 17:54:42 +0000 (12:54 -0500)
NOTE: This is a candidate for the 7.10 and 7.11 branches.

src/gallium/auxiliary/util/u_format_s3tc.c

index bb989c2..d8a7c0d 100644 (file)
@@ -119,8 +119,15 @@ util_format_s3tc_init(void)
 
    library = util_dl_open(DXTN_LIBNAME);
    if (!library) {
-      debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
-         "compression/decompression unavailable\n");
+      if (getenv("force_s3tc_enable") &&
+          !strcmp(getenv("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");
+      }
       return;
    }