[Bf-blender-cvs] [c3552081aca] temp-drawcontext: GHOST: GLX: Use a pbuffer for offscreen context.

Clément Foucault noreply at git.blender.org
Sat Feb 24 02:56:03 CET 2018


Commit: c3552081acabd5359aa396fb0769084332acabac
Author: Clément Foucault
Date:   Sat Feb 24 02:46:58 2018 +0100
Branches: temp-drawcontext
https://developer.blender.org/rBc3552081acabd5359aa396fb0769084332acabac

GHOST: GLX: Use a pbuffer for offscreen context.

Some implementation does not work well with offscreen context without a drawable surface.

===================================================================

M	intern/ghost/intern/GHOST_ContextGLX.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 04096af306d..a13590e6350 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -255,9 +255,19 @@ const bool GLXEW_ARB_create_context_robustness =
 		}
 		attribs[i++] = 0;
 
+		int pbuffer_attribs[] = {
+			GLX_PBUFFER_WIDTH, 1,
+			GLX_PBUFFER_HEIGHT, 1,
+			None
+		};
+
 		/* Create a GL 3.x context */
 		if (m_fbconfig) {
 			m_context = glXCreateContextAttribsARB(m_display, m_fbconfig, s_sharedContext, true, attribs);
+
+			if (!m_window) {
+				m_window = (Window)glXCreatePbuffer(m_display, m_fbconfig, pbuffer_attribs);
+			}
 		}
 		else {
 			GLXFBConfig *framebuffer_config = NULL;
@@ -272,6 +282,11 @@ const bool GLXEW_ARB_create_context_robustness =
 
 			if (framebuffer_config) {
 				m_context = glXCreateContextAttribsARB(m_display, framebuffer_config[0], s_sharedContext, True, attribs);
+
+				if (!m_window) {
+					m_window = (Window)glXCreatePbuffer(m_display, framebuffer_config[0], pbuffer_attribs);
+				}
+
 				XFree(framebuffer_config);
 			}
 		}



More information about the Bf-blender-cvs mailing list