summaryrefslogtreecommitdiff
path: root/dispatch
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-09-02 18:15:32 +0100
committerJose Fonseca <jfonseca@vmware.com>2016-09-02 18:15:32 +0100
commitd27737073f49ed989db5a1417122e0ada05e7961 (patch)
tree136ce631a4a220d5b9c982d60808cc592950ee65 /dispatch
parent5d5d82bf4a976f13d56b38e9b18e246f5c8a27da (diff)
dispatch: Don't rely on sys.platform to generate glproc.
Fixes https://github.com/apitrace/apitrace/issues/483
Diffstat (limited to 'dispatch')
-rw-r--r--dispatch/glproc.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/dispatch/glproc.py b/dispatch/glproc.py
index f26a4f7d..48390d13 100644
--- a/dispatch/glproc.py
+++ b/dispatch/glproc.py
@@ -502,19 +502,23 @@ class GlDispatcher(Dispatcher):
return '_getPrivateProcAddress'
def failFunction(self, function):
+ # Fallback to EXT_debug_label on MacOSX, some enums need to be translated.
+ if function.name in ('glObjectLabel', 'glObjectLabelKHR'):
+ print r'#ifdef __APPLE__'
+ print r' if (translateDebugLabelIdentifier(identifier)) {'
+ print r' _glLabelObjectEXT(identifier, name, length < 0 ? 0 : length, length == 0 ? "" : label);'
+ print r' return;'
+ print r' }'
+ print r'#endif'
+ if function.name in ('glGetObjectLabel', 'glGetObjectLabelKHR'):
+ print r'#ifdef __APPLE__'
+ print r' if (translateDebugLabelIdentifier(identifier)) {'
+ print r' _glGetObjectLabelEXT(identifier, name, bufSize, length, label);'
+ print r' return;'
+ print r' }'
+ print r'#endif'
+
# We fake these when they are not available
- if sys.platform == 'darwin':
- # Fallback to EXT_debug_label on MacOSX, some enums need to be translated.
- if function.name in ('glObjectLabel', 'glObjectLabelKHR'):
- print r' if (translateDebugLabelIdentifier(identifier)) {'
- print r' _glLabelObjectEXT(identifier, name, length < 0 ? 0 : length, length == 0 ? "" : label);'
- print r' return;'
- print r' }'
- if function.name in ('glGetObjectLabel', 'glGetObjectLabelKHR'):
- print r' if (translateDebugLabelIdentifier(identifier)) {'
- print r' _glGetObjectLabelEXT(identifier, name, bufSize, length, label);'
- print r' return;'
- print r' }'
if function.name in (
# GL_KHR_debug
'glDebugMessageControl',