aboutsummaryrefslogtreecommitdiffstats
path: root/src/mapi/glapi/gen/gl_genexec.py
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-04-27 13:32:43 +1000
committerTimothy Arceri <[email protected]>2017-05-04 11:35:36 +1000
commit2f541f63ea1829040194f31c56aeb3617fd60c15 (patch)
treee97260a39e82f7c5daad336c582057424e18da1f /src/mapi/glapi/gen/gl_genexec.py
parent33ad6226a056e727eb44aba3126ceed6e889dc7b (diff)
glapi: add KHR_no_error support to dispatch table generation
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. V3: stop the no_error attribute being overwritten when functions alias another. V2: tidy up suggested by Nicolai. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mapi/glapi/gen/gl_genexec.py')
-rw-r--r--src/mapi/glapi/gen/gl_genexec.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py
index 3a75419a752..37b1cc6be0d 100644
--- a/src/mapi/glapi/gen/gl_genexec.py
+++ b/src/mapi/glapi/gen/gl_genexec.py
@@ -232,8 +232,16 @@ class PrintCode(gl_XML.gl_print_base):
# 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()):