From 684dae9e64de180bd7b1b296c88220915376e313 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 11 Aug 2022 01:26:06 -0400 Subject: [PATCH] mesa: initialize OutsideBeginEnd directly instead of through Exec Exec is just a mutable pointer to one of the dispatch tables. OutsideBeginEnd is what we are actually initializing here. This makes the original intention clear. Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/mapi/glapi/gen/api_exec_init.py | 18 ++++++++---------- src/mesa/main/dlist.c | 2 +- src/mesa/vbo/vbo_exec_api.c | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/mapi/glapi/gen/api_exec_init.py b/src/mapi/glapi/gen/api_exec_init.py index ec1c2ea..35ac3bb 100644 --- a/src/mapi/glapi/gen/api_exec_init.py +++ b/src/mapi/glapi/gen/api_exec_init.py @@ -22,7 +22,7 @@ # This script generates the file api_exec_init.c, which contains # _mesa_initialize_exec_table(). It is responsible for populating all -# entries in the "exec" dispatch table that aren't dynamic. +# entries in the "OutsideBeginEnd" dispatch table. import argparse import collections @@ -53,21 +53,19 @@ header = """/** /** - * Initialize a context's exec table with pointers to Mesa's supported + * Initialize a context's OutsideBeginEnd table with pointers to Mesa's supported * GL functions. * * This function depends on ctx->Version. * - * \param ctx GL context to which \c exec belongs. + * \param ctx GL context */ void _mesa_initialize_exec_table(struct gl_context *ctx) { - struct _glapi_table *exec; - - exec = ctx->Exec; - assert(exec != NULL); + struct _glapi_table *table = ctx->OutsideBeginEnd; + assert(table != NULL); assert(ctx->Version > 0); """ @@ -113,12 +111,12 @@ class PrintCode(gl_XML.gl_print_base): no_error_condition = '_mesa_is_no_error_enabled(ctx) && ({0})'.format(condition) error_condition = '!_mesa_is_no_error_enabled(ctx) && ({0})'.format(condition) settings_by_condition[no_error_condition].append( - 'SET_{0}(exec, {1}{0}_no_error);'.format(f.name, prefix, f.name)) + 'SET_{0}(table, {1}{0}_no_error);'.format(f.name, prefix, f.name)) settings_by_condition[error_condition].append( - 'SET_{0}(exec, {1}{0});'.format(f.name, prefix, f.name)) + 'SET_{0}(table, {1}{0});'.format(f.name, prefix, f.name)) else: settings_by_condition[condition].append( - 'SET_{0}(exec, {1}{0});'.format(f.name, prefix, f.name)) + 'SET_{0}(table, {1}{0});'.format(f.name, prefix, f.name)) # Print out an if statement for each unique condition, with # the SET_* calls nested inside it. for condition in sorted(settings_by_condition.keys()): diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 172417f..27ec08a 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -13615,7 +13615,7 @@ _mesa_initialize_save_table(const struct gl_context *ctx) * normal-execution dispatch table. This lets us skip populating functions * that should be called directly instead of compiled into display lists. */ - memcpy(table, ctx->Exec, numEntries * sizeof(_glapi_proc)); + memcpy(table, ctx->OutsideBeginEnd, numEntries * sizeof(_glapi_proc)); #include "api_save_init.h" } diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index cff420e..1396e07 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -1076,7 +1076,7 @@ vbo_install_exec_vtxfmt(struct gl_context *ctx) #define NAME(x) _mesa_##x #define NAME_ES(x) _es_##x - struct _glapi_table *tab = ctx->Exec; + struct _glapi_table *tab = ctx->OutsideBeginEnd; #include "api_vtxfmt_init.h" if (ctx->BeginEnd) { -- 2.7.4