util: Mark util_format_description() as a const function.
authorEric Anholt <eric@anholt.net>
Wed, 1 Jul 2020 20:33:21 +0000 (13:33 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 7 Jul 2020 18:19:22 +0000 (18:19 +0000)
It will return the same table every time with no other side effects, so we
want it to be CSEed.  Saves 3.5k on my aarch64 GL drivers, almost 9k on
turnip, but weirdly increases my x86 GL driver collection by ~3k.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>

src/util/format/u_format.h

index f13dc9fc0d8d40f8270ba31c79a84fd30ad5a4cc..532b32561c13c5bb8ab98d94ab781ed3d0c29974 100644 (file)
@@ -426,7 +426,7 @@ struct util_format_description
 
 
 const struct util_format_description *
 
 
 const struct util_format_description *
-util_format_description(enum pipe_format format);
+util_format_description(enum pipe_format format) ATTRIBUTE_CONST;
 
 
 /*
 
 
 /*