Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-07-02 20:30:08 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-07-02 20:30:17 +0300
commit00808eb39ac04c484fcabac6b18666cb2a0191e7 (patch)
tree68319846e12dee6ababd82db4a4d28c1dcfe1c71 /intern/ghost
parenta5b2841aa0c4b1b90d29077ba174ed31ae8ee4d9 (diff)
Make OpenGL debug contexts a flag --debug-gpu instead of a compile time
option. This makes sense, since contexts get created at runtime, there is little reason to require recompilation for this. Only works on linux currently, will be doing more OSs later
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/GHOST_Types.h3
-rw-r--r--intern/ghost/intern/GHOST_ContextGLX.h7
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp2
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp14
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.h4
5 files changed, 15 insertions, 15 deletions
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 752a45c7473..7a73af3f249 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -57,7 +57,8 @@ typedef struct {
typedef enum {
GHOST_glStereoVisual = (1 << 0),
- GHOST_glWarnSupport = (1 << 1)
+ GHOST_glWarnSupport = (1 << 1),
+ GHOST_glDebugContext = (1 << 2),
} GHOST_GLFlags;
diff --git a/intern/ghost/intern/GHOST_ContextGLX.h b/intern/ghost/intern/GHOST_ContextGLX.h
index b33c0b5252a..04fe58a0e82 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.h
+++ b/intern/ghost/intern/GHOST_ContextGLX.h
@@ -46,11 +46,8 @@ extern "C" GLXEWContext *glxewContext;
#ifndef GHOST_OPENGL_GLX_CONTEXT_FLAGS
-# ifdef WITH_GPU_DEBUG
-# define GHOST_OPENGL_GLX_CONTEXT_FLAGS GLX_CONTEXT_DEBUG_BIT_ARB
-# else
-# define GHOST_OPENGL_GLX_CONTEXT_FLAGS 0
-# endif
+/* leave as convenience define for the future */
+#define GHOST_OPENGL_GLX_CONTEXT_FLAGS 0
#endif
#ifndef GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 45237391eff..325cba0c631 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -306,7 +306,7 @@ createWindow(const STR_String& title,
left, top, width, height,
state, parentWindow, type,
((glSettings.flags & GHOST_glStereoVisual) != 0), exclusive,
- glSettings.numOfAASamples);
+ glSettings.numOfAASamples, (glSettings.flags & GHOST_glDebugContext) != 0);
if (window) {
/* Both are now handle in GHOST_WindowX11.cpp
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index bd0d6829e27..9c66900111a 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -272,8 +272,7 @@ static XVisualInfo *x11_visualinfo_from_glx(
}
GHOST_WindowX11::
-GHOST_WindowX11(
- GHOST_SystemX11 *system,
+GHOST_WindowX11(GHOST_SystemX11 *system,
Display *display,
const STR_String &title,
GHOST_TInt32 left,
@@ -285,7 +284,7 @@ GHOST_WindowX11(
GHOST_TDrawingContextType type,
const bool stereoVisual,
const bool exclusive,
- const GHOST_TUns16 numOfAASamples)
+ const GHOST_TUns16 numOfAASamples, const bool is_debug)
: GHOST_Window(width, height, state, stereoVisual, exclusive, numOfAASamples),
m_display(display),
m_visualInfo(NULL),
@@ -301,7 +300,8 @@ GHOST_WindowX11(
#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
m_xic(NULL),
#endif
- m_valid_setup(false)
+ m_valid_setup(false),
+ m_is_debug_context(is_debug)
{
if (type == GHOST_kDrawingContextTypeOpenGL) {
m_visualInfo = x11_visualinfo_from_glx(m_display, stereoVisual, &m_wantNumOfAASamples);
@@ -1284,7 +1284,7 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
m_visualInfo,
GLX_CONTEXT_OPENGL_CORE_PROFILE_BIT,
3, 2,
- GHOST_OPENGL_GLX_CONTEXT_FLAGS,
+ GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY);
#elif defined(WITH_GL_PROFILE_ES20)
GHOST_Context *context = new GHOST_ContextGLX(
@@ -1295,7 +1295,7 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
m_visualInfo,
GLX_CONTEXT_ES2_PROFILE_BIT_EXT,
2, 0,
- GHOST_OPENGL_GLX_CONTEXT_FLAGS,
+ GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY);
#elif defined(WITH_GL_PROFILE_COMPAT)
GHOST_Context *context = new GHOST_ContextGLX(
@@ -1306,7 +1306,7 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
m_visualInfo,
0, // profile bit
0, 0,
- GHOST_OPENGL_GLX_CONTEXT_FLAGS,
+ GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY);
#else
# error
diff --git a/intern/ghost/intern/GHOST_WindowX11.h b/intern/ghost/intern/GHOST_WindowX11.h
index 77287c1befc..5beb7b43032 100644
--- a/intern/ghost/intern/GHOST_WindowX11.h
+++ b/intern/ghost/intern/GHOST_WindowX11.h
@@ -88,7 +88,8 @@ public:
GHOST_TDrawingContextType type = GHOST_kDrawingContextTypeNone,
const bool stereoVisual = false,
const bool exclusive = false,
- const GHOST_TUns16 numOfAASamples = 0
+ const GHOST_TUns16 numOfAASamples = 0,
+ const bool is_debug = false
);
bool
@@ -354,6 +355,7 @@ private:
#endif
bool m_valid_setup;
+ bool m_is_debug_context;
void icccmSetState(int state);
int icccmGetState() const;