From 862b00b795f9c15f28a93a8c4a024911fd72e0e6 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 11 Aug 2022 03:00:40 -0400 Subject: mesa: put dispatch table initialization into one place We have 3 new/changed functions with this commit: 1. _mesa_alloc_dispatch_tables creates all dispatch tables that are not created on demand and sets them to nop. This operates on gl_dispatch, so it's reusable (e.g. glthread will want to use it) 2. _mesa_free_dispatch_tables frees everything 3. _mesa_initialize_dispatch_tables initializes gl_dispatch for GL (not glthread) Acked-by: Adam Jackson Part-of: --- src/mesa/state_tracker/st_context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/state_tracker/st_context.c') diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 37b809a49ea..a60d18447c5 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -769,7 +769,8 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, _mesa_override_extensions(ctx); _mesa_compute_version(ctx); - if (ctx->Version == 0) { + if (ctx->Version == 0 || + !_mesa_initialize_dispatch_tables(ctx)) { /* This can happen when a core profile was requested, but the driver * does not support some features of GL 3.1 or later. */ @@ -793,7 +794,6 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe, */ _vbo_CreateContext(ctx); - _mesa_initialize_dispatch_tables(ctx); st_init_driver_flags(st); /* Initialize context's winsys buffers list */ -- cgit v1.2.3