util: Make all 3 fetch_rgba functions occupy the same function slot.

A single format either had the float, the sint, or the uint version.
Making the dst be void * lets us store them in the same slot and not have
logic in the callers to call the right one.

-6kb on gallium drivers

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6305>
This commit is contained in:
Eric Anholt
2020-08-13 09:15:16 -07:00
committed by Marge Bot
parent 80babbbf7e
commit 35b22b5da0
22 changed files with 103 additions and 108 deletions
+3 -3
View File
@@ -240,12 +240,14 @@ def write_format_table(formats):
continue
print(" [%s] = {" % (format.name,))
if format.colorspace != ZS:
print(" .fetch_rgba = &util_format_%s_fetch_rgba," % sn)
if format.colorspace != ZS and not format.is_pure_color():
print(" .unpack_rgba_8unorm = &util_format_%s_unpack_rgba_8unorm," % sn)
if format.layout == 's3tc' or format.layout == 'rgtc':
print(" .fetch_rgba_8unorm = &util_format_%s_fetch_rgba_8unorm," % sn)
print(" .unpack_rgba = &util_format_%s_unpack_rgba_float," % sn)
print(" .fetch_rgba_float = &util_format_%s_fetch_rgba_float," % sn)
if format.has_depth():
print(" .unpack_z_32unorm = &util_format_%s_unpack_z_32unorm," % sn)
@@ -256,10 +258,8 @@ def write_format_table(formats):
if format.is_pure_unsigned():
print(" .unpack_rgba = &util_format_%s_unpack_unsigned," % sn)
print(" .fetch_rgba_uint = &util_format_%s_fetch_unsigned," % sn)
elif format.is_pure_signed():
print(" .unpack_rgba = &util_format_%s_unpack_signed," % sn)
print(" .fetch_rgba_sint = &util_format_%s_fetch_signed," % sn)
print(" },")
print("};")
print()