gallium/util: use new util_vasprintf() function
[mesa.git] / src / gallium / auxiliary / util / u_format_table.py
old mode 100755 (executable)
new mode 100644 (file)
index ad582e4..a09ae53
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 
 CopyRight = '''
 /**************************************************************************
@@ -69,13 +68,13 @@ def bool_map(value):
 
 
 swizzle_map = {
-    SWIZZLE_X:    "UTIL_FORMAT_SWIZZLE_X",
-    SWIZZLE_Y:    "UTIL_FORMAT_SWIZZLE_Y",
-    SWIZZLE_Z:    "UTIL_FORMAT_SWIZZLE_Z",
-    SWIZZLE_W:    "UTIL_FORMAT_SWIZZLE_W",
-    SWIZZLE_0:    "UTIL_FORMAT_SWIZZLE_0",
-    SWIZZLE_1:    "UTIL_FORMAT_SWIZZLE_1",
-    SWIZZLE_NONE: "UTIL_FORMAT_SWIZZLE_NONE",
+    SWIZZLE_X:    "PIPE_SWIZZLE_X",
+    SWIZZLE_Y:    "PIPE_SWIZZLE_Y",
+    SWIZZLE_Z:    "PIPE_SWIZZLE_Z",
+    SWIZZLE_W:    "PIPE_SWIZZLE_W",
+    SWIZZLE_0:    "PIPE_SWIZZLE_0",
+    SWIZZLE_1:    "PIPE_SWIZZLE_1",
+    SWIZZLE_NONE: "PIPE_SWIZZLE_NONE",
 }
 
 
@@ -90,7 +89,6 @@ def write_format_table(formats):
     print '#include "u_format_rgtc.h"'
     print '#include "u_format_latc.h"'
     print '#include "u_format_etc.h"'
-    print '#include "u_format_bptc.h"'
     print
     
     u_format_pack.generate(formats)
@@ -139,10 +137,15 @@ def write_format_table(formats):
         u_format_pack.print_channels(format, do_channel_array)
         u_format_pack.print_channels(format, do_swizzle_array)
         print "   %s," % (colorspace_map(format.colorspace),)
-        if format.colorspace != ZS and not format.is_pure_color():
+        access = True
+        if format.layout in ('bptc', 'astc'):
+            access = False
+        if format.layout == 'etc' and format.short_name() != 'etc1_rgb8':
+            access = False
+        if format.colorspace != ZS and not format.is_pure_color() and access:
             print "   &util_format_%s_unpack_rgba_8unorm," % format.short_name() 
             print "   &util_format_%s_pack_rgba_8unorm," % format.short_name() 
-            if format.layout == 's3tc' or format.layout == 'rgtc' or format.layout == 'bptc':
+            if format.layout == 's3tc' or format.layout == 'rgtc':
                 print "   &util_format_%s_fetch_rgba_8unorm," % format.short_name()
             else:
                 print "   NULL, /* fetch_rgba_8unorm */"