mesa/st: Use do_once for one-time init

Also, since there is a second call-path into st_init_extensions() from
get_version(), add an extra st_debug_init() call.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7644>
This commit is contained in:
Rob Clark 2020-11-23 14:30:32 -08:00 committed by Marge Bot
parent 2e81ec5e00
commit bcb2981e14
2 changed files with 5 additions and 1 deletions

View file

@ -68,7 +68,9 @@ DEBUG_GET_ONCE_FLAGS_OPTION(st_debug, "ST_DEBUG", st_debug_flags, 0)
void
st_debug_init(void)
{
ST_DEBUG = debug_get_option_st_debug();
do_once {
ST_DEBUG = debug_get_option_st_debug();
}
}

View file

@ -1040,6 +1040,8 @@ void st_init_extensions(struct pipe_screen *screen,
} },
};
st_debug_init();
/*
* Extensions that are supported by all Gallium drivers:
*/