summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_context.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2022-08-11 03:00:40 -0400
committerMarek Olšák <marek.olsak@amd.com>2023-03-12 17:56:16 -0400
commit862b00b795f9c15f28a93a8c4a024911fd72e0e6 (patch)
treed51214eb83d8bcd2c56edc29c94c9810655a0990 /src/mesa/state_tracker/st_context.c
parentdae902e11ef47ae49062b6a38d4d425d4fef44ae (diff)
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 <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21777>
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r--src/mesa/state_tracker/st_context.c4
1 files changed, 2 insertions, 2 deletions
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 */