This will allows us to create no error versions of functions noted by a _no_error suffix. We also need to set a no_error attribute equal to "true" in the xml.
V2: tidy up suggested by Nicolai --- src/mapi/glapi/gen/gl_XML.py | 5 +++++ src/mapi/glapi/gen/gl_genexec.py | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py index c688906..603ef73 100644 --- a/src/mapi/glapi/gen/gl_XML.py +++ b/src/mapi/glapi/gen/gl_XML.py @@ -669,20 +669,25 @@ class gl_function( gl_item ): if exec_flavor: self.exec_flavor = exec_flavor deprecated = element.get('deprecated', 'none') if deprecated != 'none': self.deprecated = Decimal(deprecated) if not is_attr_true(element, 'desktop', 'true'): self.desktop = False + if is_attr_true(element, 'no_error'): + self.has_no_error_variant = True + else: + self.has_no_error_variant = False + if alias: true_name = alias else: true_name = name # Only try to set the offset when a non-alias entry-point # is being processed. if name in static_data.offsets: self.offset = static_data.offsets[name] diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py index 3a75419..37b1cc6 100644 --- a/src/mapi/glapi/gen/gl_genexec.py +++ b/src/mapi/glapi/gen/gl_genexec.py @@ -225,22 +225,30 @@ class PrintCode(gl_XML.gl_print_base): if not condition_parts: # This function does not exist in any API. continue condition = ' || '.join(condition_parts) prefix = exec_flavor_map[f.exec_flavor] if prefix is None: # This function is not implemented, or is dispatched # dynamically. continue - settings_by_condition[condition].append( - 'SET_{0}(exec, {1}{0});'.format(f.name, prefix, f.name)) + if f.has_no_error_variant: + 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)) + settings_by_condition[error_condition].append( + 'SET_{0}(exec, {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)) # Print out an if statement for each unique condition, with # the SET_* calls nested inside it. for condition in sorted(settings_by_condition.keys()): print ' if ({0}) {{'.format(condition) for setting in sorted(settings_by_condition[condition]): print ' {0}'.format(setting) print ' }' def _parser(): -- 2.9.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev