diff options
author | Roland Scheidegger <sroland@vmware.com> | 2015-04-16 22:24:35 +0200 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2015-04-21 11:45:38 +0100 |
commit | 98a8ca1c48592892eb3a6a6518cd85613624dfcc (patch) | |
tree | 9b492f2ca04c4a148bdd3c559380744e21189559 /dispatch | |
parent | c7d4045742862a7cf3f0074902ebc7d1b339b0ee (diff) |
gltrace, glretrace: translate enums if emulating KHR_debug with EXT_debug_label
Some of the identifiers (types in EXT_debug_label) are different between these
two extensions, which led to GL errors when applications used KHR_debug with
those. (The only non-translatable one seems to be GL_DISPLAY_LIST which is
compat only.)
Diffstat (limited to 'dispatch')
-rw-r--r-- | dispatch/glproc.py | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/dispatch/glproc.py b/dispatch/glproc.py index 81c30ad4..a94cefee 100644 --- a/dispatch/glproc.py +++ b/dispatch/glproc.py @@ -504,11 +504,69 @@ class GlDispatcher(Dispatcher): def failFunction(self, function): # We fake these when they are not available if sys.platform == 'darwin': - # Fallback to EXT_debug_label on MacOSX + # Fallback to EXT_debug_label on MacOSX, some enums need to be translated. if function.name == 'glObjectLabel': + print r' switch(identifier) {' + print r' case GL_TEXTURE:' + print r' case GL_FRAMEBUFFER:' + print r' case GL_RENDERBUFFER:' + print r' case GL_SAMPLER:' + print r' case GL_TRANSFORM_FEEDBACK:' + print r' break;' + print r' case GL_BUFFER:' + print r' identifier = GL_BUFFER_OBJECT_EXT;' + print r' break;' + print r' case GL_SHADER:' + print r' identifier = GL_SHADER_OBJECT_EXT;' + print r' break;' + print r' case GL_PROGRAM:' + print r' identifier = GL_PROGRAM_OBJECT_EXT;' + print r' break;' + print r' case GL_VERTEX_ARRAY:' + print r' identifier = GL_VERTEX_ARRAY_OBJECT_EXT;' + print r' break;' + print r' case GL_QUERY:' + print r' identifier = GL_QUERY_OBJECT_EXT;' + print r' break;' + print r' case GL_PROGRAM_PIPELINE:' + print r' identifier = GL_PROGRAM_PIPELINE_OBJECT_EXT;' + print r' break;' + print r' default:' + print r' return;' + print r' }' print r' _glLabelObjectEXT(identifier, name, length < 0 ? 0 : length, length == 0 ? "" : label);' return if function.name == 'glGetObjectLabel': + print r' switch(identifier) {' + print r' case GL_TEXTURE:' + print r' case GL_FRAMEBUFFER:' + print r' case GL_RENDERBUFFER:' + print r' case GL_SAMPLER:' + print r' case GL_TRANSFORM_FEEDBACK:' + print r' break;' + print r' case GL_BUFFER:' + print r' identifier = GL_BUFFER_OBJECT_EXT;' + print r' break;' + print r' case GL_SHADER:' + print r' identifier = GL_SHADER_OBJECT_EXT;' + print r' break;' + print r' case GL_PROGRAM:' + print r' identifier = GL_PROGRAM_OBJECT_EXT;' + print r' break;' + print r' case GL_VERTEX_ARRAY:' + print r' identifier = GL_VERTEX_ARRAY_OBJECT_EXT;' + print r' break;' + print r' case GL_QUERY:' + print r' identifier = GL_QUERY_OBJECT_EXT;' + print r' break;' + print r' case GL_PROGRAM_PIPELINE:' + print r' identifier = GL_PROGRAM_PIPELINE_OBJECT_EXT;' + print r' break;' + print r' default:' + print r' if (length != 0) *length = 0;' + print r' if (label != 0 && bufSize > 0) *label = 0;' + print r' return;' + print r' }' print r' _glGetObjectLabelEXT(identifier, name, bufSize, length, label);' return if function.name in ( |