util: Reorder the code generated function so that they are grouped by format.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 8 Apr 2010 15:24:43 +0000 (16:24 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 8 Apr 2010 18:03:40 +0000 (19:03 +0100)
Makes it easier to copy and paste.

src/gallium/auxiliary/util/u_format_pack.py

index 075f8caa30e90640900192afe25ee3586a550e1a..95d769103682d23cda8b0c725b97628c57c50974 100644 (file)
@@ -657,22 +657,18 @@ def generate(formats):
         if is_format_supported(format):
             generate_format_type(format)
 
-    channel = Channel(FLOAT, False, 32)
-    native_type = 'float'
-    suffix = 'float'
-
-    for format in formats:
         if not is_format_hand_written(format):
+            channel = Channel(FLOAT, False, 32)
+            native_type = 'float'
+            suffix = 'float'
+
             generate_format_unpack(format, channel, native_type, suffix)
             generate_format_pack(format, channel, native_type, suffix)
             generate_format_fetch(format, channel, native_type, suffix)
 
-    channel = Channel(UNSIGNED, True, 8)
-    native_type = 'uint8_t'
-    suffix = '8unorm'
+            channel = Channel(UNSIGNED, True, 8)
+            native_type = 'uint8_t'
+            suffix = '8unorm'
 
-    for format in formats:
-        if not is_format_hand_written(format):
             generate_format_unpack(format, channel, native_type, suffix)
             generate_format_pack(format, channel, native_type, suffix)
-