summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2022-08-11 09:27:52 -0400
committerMarge Bot <emma+marge@anholt.net>2022-10-19 04:23:05 +0000
commit146836f4ba659269e31f6ae865af9015faca5dff (patch)
tree6d14d49f70a0d29928f580cfb56f9d2eacc57eda /src
parent67c7260571b0b6dc8f6f6b4f659333275383e969 (diff)
gl_marshal.py: remove the -O1 hack and manual SET_* inlining
The compile times aren't so bad anymore now that the initialization is split among all 8 files. Also add one assertion. Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18199>
Diffstat (limited to 'src')
-rw-r--r--src/mapi/glapi/gen/gl_marshal.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py
index f1f355b62ab..b87c45bcfd3 100644
--- a/src/mapi/glapi/gen/gl_marshal.py
+++ b/src/mapi/glapi/gen/gl_marshal.py
@@ -192,6 +192,7 @@ class PrintCode(gl_XML.gl_print_base):
val = mapping.get(str, 9999)
if val == 9999:
print('Unhandled type in gl_marshal.py.get_type_size: ' + str, file=sys.stderr)
+ assert False
return val
def print_async_struct(self, func):
@@ -367,10 +368,6 @@ class PrintCode(gl_XML.gl_print_base):
out('')
def print_init_marshal_table(self, functions):
- out('/* _mesa_create_marshal_table takes a long time to compile with -O2 */')
- out('#if defined(__GNUC__) && !defined(__clang__)')
- out('__attribute__((optimize("O1")))')
- out('#endif')
out('void')
out('_mesa_glthread_init_dispatch%u(struct gl_context *ctx, '
'struct _glapi_table *table)' % file_index)
@@ -385,12 +382,8 @@ class PrintCode(gl_XML.gl_print_base):
if not condition:
continue
- # Don't use the SET_* functions, because they increase compile time
- # by 20 seconds (on Ryzen 1700X).
settings_by_condition[condition].append(
- ('if (_gloffset_{0} >= 0)\n' +
- ' ((_glapi_proc *)table)[_gloffset_{0}] =' +
- ' (_glapi_proc)_mesa_marshal_{0};').format(func.name))
+ 'SET_{0}(table, _mesa_marshal_{0});'.format(func.name))
# Print out an if statement for each unique condition, with
# the SET_* calls nested inside it.