postprocess: move the definition of pp_filters into **/pp_init.c
authorDavid Heidelberg <david.heidelberg@collabora.com>
Mon, 2 Jan 2023 23:25:52 +0000 (00:25 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 3 Jan 2023 14:45:28 +0000 (14:45 +0000)
An LTO-friendly move.

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7881

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20374>

src/gallium/auxiliary/postprocess/filters.h
src/gallium/auxiliary/postprocess/pp_init.c

index 321f333..c582721 100644 (file)
@@ -49,16 +49,5 @@ struct pp_filter_t
    pp_free_func free;           /* Free function */
 };
 
-/*     Order matters. Put new filters in a suitable place. */
-
-static const struct pp_filter_t pp_filters[PP_FILTERS] = {
-/*    name                     inner   shaders verts   init                    run                       free   */
-   { "pp_noblue",              0,      2,      1,      pp_noblue_init,         pp_nocolor,               pp_nocolor_free },
-   { "pp_nogreen",             0,      2,      1,      pp_nogreen_init,        pp_nocolor,               pp_nocolor_free },
-   { "pp_nored",               0,      2,      1,      pp_nored_init,          pp_nocolor,               pp_nocolor_free },
-   { "pp_celshade",            0,      2,      1,      pp_celshade_init,       pp_nocolor,               pp_celshade_free },
-   { "pp_jimenezmlaa",         2,      5,      2,      pp_jimenezmlaa_init,    pp_jimenezmlaa,           pp_jimenezmlaa_free },
-   { "pp_jimenezmlaa_color",   2,      5,      2,      pp_jimenezmlaa_init_color, pp_jimenezmlaa_color,  pp_jimenezmlaa_free },
-};
-
+extern const struct pp_filter_t pp_filters[PP_FILTERS];
 #endif
index 4d551db..cdaa464 100644 (file)
 #include "util/u_memory.h"
 #include "cso_cache/cso_context.h"
 
+const struct pp_filter_t pp_filters[PP_FILTERS] = {
+/*    name                     inner   shaders verts   init                    run                       free   */
+   { "pp_noblue",              0,      2,      1,      pp_noblue_init,         pp_nocolor,               pp_nocolor_free },
+   { "pp_nogreen",             0,      2,      1,      pp_nogreen_init,        pp_nocolor,               pp_nocolor_free },
+   { "pp_nored",               0,      2,      1,      pp_nored_init,          pp_nocolor,               pp_nocolor_free },
+   { "pp_celshade",            0,      2,      1,      pp_celshade_init,       pp_nocolor,               pp_celshade_free },
+   { "pp_jimenezmlaa",         2,      5,      2,      pp_jimenezmlaa_init,    pp_jimenezmlaa,           pp_jimenezmlaa_free },
+   { "pp_jimenezmlaa_color",   2,      5,      2,      pp_jimenezmlaa_init_color, pp_jimenezmlaa_color,  pp_jimenezmlaa_free },
+};
+
 /** Initialize the post-processing queue. */
 struct pp_queue_t *
 pp_init(struct pipe_context *pipe, const unsigned int *enabled,