summaryrefslogtreecommitdiffstats
path: root/src/egl/main
diff options
context:
space:
mode:
authorKyle Brenneman <kbrenneman@nvidia.com>2016-09-12 16:15:10 -0400
committerAdam Jackson <ajax@redhat.com>2016-09-14 11:45:58 -0400
commit7206b3a5565c0835589f85388ae9c121dfd5b5a5 (patch)
treecc784c3efe12613fa49d4581bb88e8d47b628c10 /src/egl/main
parent1d535c1e83ae45b67a141420298c5d08082e0ed8 (diff)
downloadexternal_mesa3d-7206b3a5565c0835589f85388ae9c121dfd5b5a5.zip
external_mesa3d-7206b3a5565c0835589f85388ae9c121dfd5b5a5.tar.gz
external_mesa3d-7206b3a5565c0835589f85388ae9c121dfd5b5a5.tar.bz2
egl: Add storage for EGL_KHR_debug's state to EGL objects
Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/egl/main')
-rw-r--r--src/egl/main/eglcurrent.c3
-rw-r--r--src/egl/main/eglcurrent.h8
-rw-r--r--src/egl/main/egldisplay.h4
-rw-r--r--src/egl/main/eglglobals.c5
-rw-r--r--src/egl/main/eglglobals.h10
5 files changed, 27 insertions, 3 deletions
diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c
index 2a225bc..f093bec 100644
--- a/src/egl/main/eglcurrent.c
+++ b/src/egl/main/eglcurrent.c
@@ -35,10 +35,9 @@
#include "eglcurrent.h"
#include "eglglobals.h"
-
/* This should be kept in sync with _eglInitThreadInfo() */
#define _EGL_THREAD_INFO_INITIALIZER \
- { EGL_SUCCESS, NULL, 0 }
+ { EGL_SUCCESS, NULL, 0, NULL, NULL, NULL }
/* a fallback thread info to guarantee that every thread always has one */
static _EGLThreadInfo dummy_thread = _EGL_THREAD_INFO_INITIALIZER;
diff --git a/src/egl/main/eglcurrent.h b/src/egl/main/eglcurrent.h
index b922435..b2638fd 100644
--- a/src/egl/main/eglcurrent.h
+++ b/src/egl/main/eglcurrent.h
@@ -54,6 +54,14 @@ struct _egl_thread_info
EGLint LastError;
_EGLContext *CurrentContext;
EGLenum CurrentAPI;
+ EGLLabelKHR Label;
+
+ /**
+ * The name of the EGL function that's being called at the moment. This is
+ * used to report the function name to the EGL_KHR_debug callback.
+ */
+ const char *CurrentFuncName;
+ EGLLabelKHR CurrentObjectLabel;
};
diff --git a/src/egl/main/egldisplay.h b/src/egl/main/egldisplay.h
index 6f3340e..22fb5c8 100644
--- a/src/egl/main/egldisplay.h
+++ b/src/egl/main/egldisplay.h
@@ -79,6 +79,8 @@ struct _egl_resource
EGLBoolean IsLinked;
EGLint RefCount;
+ EGLLabelKHR Label;
+
/* used to link resources of the same type */
_EGLResource *Next;
};
@@ -165,6 +167,8 @@ struct _egl_display
/* lists of resources */
_EGLResource *ResourceLists[_EGL_NUM_RESOURCES];
+
+ EGLLabelKHR Label;
};
diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c
index 04bb5ba..dca5c21 100644
--- a/src/egl/main/eglglobals.c
+++ b/src/egl/main/eglglobals.c
@@ -56,7 +56,10 @@ struct _egl_global _eglGlobal =
" EGL_EXT_platform_wayland"
" EGL_EXT_platform_x11"
" EGL_KHR_client_get_all_proc_addresses"
- " EGL_MESA_platform_gbm"
+ " EGL_MESA_platform_gbm",
+
+ NULL, /* debugCallback */
+ _EGL_DEBUG_BIT_CRITICAL | _EGL_DEBUG_BIT_ERROR, /* debugTypesEnabled */
};
diff --git a/src/egl/main/eglglobals.h b/src/egl/main/eglglobals.h
index ae1b75b..dfa3577 100644
--- a/src/egl/main/eglglobals.h
+++ b/src/egl/main/eglglobals.h
@@ -36,6 +36,13 @@
#include "egltypedefs.h"
+enum
+{
+ _EGL_DEBUG_BIT_CRITICAL = 0x1,
+ _EGL_DEBUG_BIT_ERROR = 0x2,
+ _EGL_DEBUG_BIT_WARN = 0x4,
+ _EGL_DEBUG_BIT_INFO = 0x8,
+};
/**
* Global library data
@@ -51,6 +58,9 @@ struct _egl_global
void (*AtExitCalls[10])(void);
const char *ClientExtensionString;
+
+ EGLDEBUGPROCKHR debugCallback;
+ unsigned int debugTypesEnabled;
};