summaryrefslogtreecommitdiff
path: root/dispatch
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-06-27 11:07:05 +0100
committerJose Fonseca <jfonseca@vmware.com>2015-06-27 11:07:05 +0100
commite01aa3bc8a84cf122187de5d16aad2c8772949e3 (patch)
tree7c81d9a6dd27ae81ea58362793d1a72a96b1ecb7 /dispatch
parentd5ac9ad120439327b042681669fe6f2d3daed8d7 (diff)
egltrace: Properly support KHR_debug on ES.
KHR_debug spec states that on OpenGL ES all entrypoints should have KHR suffixes.
Diffstat (limited to 'dispatch')
-rw-r--r--dispatch/eglimports.hpp5
-rw-r--r--dispatch/glproc.py28
2 files changed, 21 insertions, 12 deletions
diff --git a/dispatch/eglimports.hpp b/dispatch/eglimports.hpp
index 95b52ee8..29b3342a 100644
--- a/dispatch/eglimports.hpp
+++ b/dispatch/eglimports.hpp
@@ -57,6 +57,9 @@
#define GL_NV_coverage_sample
#include "GLES2/gl2ext.h"
+// GLDEBUGPROCKHR is not defined because GL_KHR_debug was already defined
+typedef void (GL_APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+
// OpenGL ES 1.1
typedef int32_t GLfixed;
@@ -85,5 +88,3 @@ typedef int32_t GLclampx;
#undef _glext_h_
#include "GLES/glext.h"
-
-
diff --git a/dispatch/glproc.py b/dispatch/glproc.py
index 8e4dddad..f26a4f7d 100644
--- a/dispatch/glproc.py
+++ b/dispatch/glproc.py
@@ -505,12 +505,12 @@ class GlDispatcher(Dispatcher):
# 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 == 'glObjectLabel':
+ 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 == 'glGetObjectLabel':
+ if function.name in ('glGetObjectLabel', 'glGetObjectLabelKHR'):
print r' if (translateDebugLabelIdentifier(identifier)) {'
print r' _glGetObjectLabelEXT(identifier, name, bufSize, length, label);'
print r' return;'
@@ -524,6 +524,14 @@ class GlDispatcher(Dispatcher):
'glPopDebugGroup',
'glObjectLabel',
'glObjectPtrLabel',
+ # GL_KHR_debug (OpenGL ES)
+ 'glDebugMessageControlKHR',
+ 'glDebugMessageInsertKHR',
+ 'glDebugMessageCallbackKHR',
+ 'glPushDebugGroupKHR',
+ 'glPopDebugGroupKHR',
+ 'glObjectLabelKHR',
+ 'glObjectPtrLabelKHR',
# GL_ARB_debug_output
'glDebugMessageControlARB',
'glDebugMessageInsertARB',
@@ -540,25 +548,25 @@ class GlDispatcher(Dispatcher):
'glPopGroupMarkerEXT',
):
return
- if function.name in ('glGetObjectLabel', 'glGetObjectPtrLabel', 'glGetObjectLabelEXT'):
+ if function.name.startswith('glGetObjectLabel'):
print r' if (length != 0) *length = 0;'
print r' if (label != 0 && bufSize > 0) *label = 0;'
return
- if function.name in ('glGetDebugMessageLog', 'glGetDebugMessageLogARB'):
- print r' if (sources != 0) *sources = 0;'
- print r' if (types != 0) *types = 0;'
+ if function.name == 'glGetDebugMessageLogAMD':
+ print r' if (categories != 0) *categories = 0;'
print r' if (ids != 0) *ids = 0;'
print r' if (severities != 0) *severities = 0;'
print r' if (lengths != 0) *lengths = 0;'
- print r' if (messageLog != 0 && bufsize > 0) *messageLog = 0;'
+ print r' if (message != 0 && bufsize > 0) *message = 0;'
print r' return 0;'
return
- if function.name in ('glGetDebugMessageLogAMD'):
- print r' if (categories != 0) *categories = 0;'
+ if function.name.startswith('glGetDebugMessageLog'):
+ print r' if (sources != 0) *sources = 0;'
+ print r' if (types != 0) *types = 0;'
print r' if (ids != 0) *ids = 0;'
print r' if (severities != 0) *severities = 0;'
print r' if (lengths != 0) *lengths = 0;'
- print r' if (message != 0 && bufsize > 0) *message = 0;'
+ print r' if (messageLog != 0 && bufsize > 0) *messageLog = 0;'
print r' return 0;'
return