Mesa (master): util: Drop unpacking from int signed to unsigned and vice versa.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 4 19:24:28 UTC 2020


Module: Mesa
Branch: master
Commit: 8a2c507a8abe2537df5bc1f4847c40e6d4314dec
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8a2c507a8abe2537df5bc1f4847c40e6d4314dec

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Nov 11 15:52:53 2019 -0800

util: Drop unpacking from int signed to unsigned and vice versa.

After all the previous cleanups, it's clear that the callers only ever
ask for SINT->SINT or UINT->UINT.  Cuts 20k of compiled text from
gallium drivers.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2744>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2744>

---

 src/util/format/u_format_pack.py  | 2 --
 src/util/format/u_format_table.py | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/util/format/u_format_pack.py b/src/util/format/u_format_pack.py
index 0653e5e4a9e..5a1763d1e6f 100644
--- a/src/util/format/u_format_pack.py
+++ b/src/util/format/u_format_pack.py
@@ -727,7 +727,6 @@ def generate(formats):
                 channel = Channel(SIGNED, False, True, 32)
                 native_type = 'int'
                 suffix = 'signed'
-                generate_format_unpack(format, channel, native_type, suffix)
                 generate_format_pack(format, channel, native_type, suffix)   
             elif format.is_pure_signed():
                 native_type = 'int'
@@ -741,7 +740,6 @@ def generate(formats):
                 native_type = 'unsigned'
                 suffix = 'unsigned'
                 channel = Channel(UNSIGNED, False, True, 32)
-                generate_format_unpack(format, channel, native_type, suffix)
                 generate_format_pack(format, channel, native_type, suffix)   
             else:
                 channel = Channel(FLOAT, False, False, 32)
diff --git a/src/util/format/u_format_table.py b/src/util/format/u_format_table.py
index 2bc82c36f42..336de4b31b4 100644
--- a/src/util/format/u_format_table.py
+++ b/src/util/format/u_format_table.py
@@ -182,12 +182,12 @@ def write_format_table(formats):
         if format.is_pure_unsigned():
             print("   &util_format_%s_unpack_unsigned, /* unpack_rgba_uint */" % format.short_name())
             print("   &util_format_%s_pack_unsigned, /* pack_rgba_uint */" % format.short_name())
-            print("   &util_format_%s_unpack_signed, /* unpack_rgba_sint */" % format.short_name())
+            print("   NULL, /* unpack_rgba_sint */")
             print("   &util_format_%s_pack_signed,  /* pack_rgba_sint */" % format.short_name())
             print("   &util_format_%s_fetch_unsigned,  /* fetch_rgba_uint */" % format.short_name())
             print("   NULL  /* fetch_rgba_sint */")
         elif format.is_pure_signed():
-            print("   &util_format_%s_unpack_unsigned, /* unpack_rgba_uint */" % format.short_name())
+            print("   NULL, /* unpack_rgba_uint */")
             print("   &util_format_%s_pack_unsigned, /* pack_rgba_uint */" % format.short_name())
             print("   &util_format_%s_unpack_signed, /* unpack_rgba_sint */" % format.short_name())
             print("   &util_format_%s_pack_signed,  /* pack_rgba_sint */" % format.short_name())



More information about the mesa-commit mailing list