fix the allow-forcing-llvmpipe patch to patch actual caller of __glXInitialize

* Wed Jan 29 2014 Kevin Kofler <Kevin@tigcc.ticalc.org> - 5.2.0-10
- fix the allow-forcing-llvmpipe patch to patch actual caller of __glXInitialize
This commit is contained in:
Kevin Kofler 2014-01-29 16:49:50 +01:00
parent 7b8ca8473e
commit cdc6229b7e
2 changed files with 18 additions and 43 deletions

View File

@ -26,7 +26,7 @@
Summary: Qt5 - QtBase components
Name: qt5-qtbase
Version: 5.2.0
Release: 9%{?dist}
Release: 10%{?dist}
# See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
@ -688,6 +688,9 @@ popd
%changelog
* Wed Jan 29 2014 Kevin Kofler <Kevin@tigcc.ticalc.org> - 5.2.0-10
- fix the allow-forcing-llvmpipe patch to patch actual caller of __glXInitialize
* Wed Jan 29 2014 Kevin Kofler <Kevin@tigcc.ticalc.org> - 5.2.0-9
- use software OpenGL (llvmpipe) if the hardware driver doesn't support OpenGL 2

View File

@ -1,10 +1,10 @@
diff -ur qtbase-opensource-src-5.2.0/src/plugins/platforms/xcb/qglxintegration.cpp qtbase-opensource-src-5.2.0-allow-forcing-llvmpipe/src/plugins/platforms/xcb/qglxintegration.cpp
--- qtbase-opensource-src-5.2.0/src/plugins/platforms/xcb/qglxintegration.cpp 2013-12-08 18:09:53.000000000 +0100
+++ qtbase-opensource-src-5.2.0-allow-forcing-llvmpipe/src/plugins/platforms/xcb/qglxintegration.cpp 2014-01-29 02:58:13.000000000 +0100
@@ -173,6 +173,27 @@
if (m_format.renderableType() != QSurfaceFormat::OpenGL && m_format.renderableType() != QSurfaceFormat::OpenGLES)
return;
diff -ur qtbase-opensource-src-5.2.0/src/platformsupport/glxconvenience/qglxconvenience.cpp qtbase-opensource-src-5.2.0-allow-forcing-llvmpipe/src/platformsupport/glxconvenience/qglxconvenience.cpp
--- qtbase-opensource-src-5.2.0/src/platformsupport/glxconvenience/qglxconvenience.cpp 2013-12-08 18:09:47.000000000 +0100
+++ qtbase-opensource-src-5.2.0-allow-forcing-llvmpipe/src/platformsupport/glxconvenience/qglxconvenience.cpp 2014-01-29 16:41:53.000000000 +0100
@@ -116,6 +116,27 @@
GLXFBConfig qglx_findConfig(Display *display, int screen , const QSurfaceFormat &format, int drawableBit)
{
+ // Allow forcing LIBGL_ALWAYS_SOFTWARE for Qt 5 applications only.
+ // This is most useful with drivers that only support OpenGL 1.
+ // We need OpenGL 2, but the user probably doesn't want
@ -26,45 +26,17 @@ diff -ur qtbase-opensource-src-5.2.0/src/plugins/platforms/xcb/qglxintegration.c
+ if (forceSoftwareOpenGL)
+ qputenv("LIBGL_ALWAYS_SOFTWARE", "1");
+
if (share)
m_shareContext = static_cast<const QGLXContext*>(share)->glxContext();
bool reduced = true;
GLXFBConfig chosenConfig = 0;
QSurfaceFormat reducedFormat = format;
@@ -159,6 +180,10 @@
reducedFormat = qglx_reduceSurfaceFormat(reducedFormat,&reduced);
}
@@ -267,8 +288,12 @@
// Could not create a context using glXCreateContextAttribsARB, falling back to glXCreateNewContext.
if (!m_context) {
// requesting an OpenGL ES context requires glXCreateContextAttribsARB, so bail out
- if (m_format.renderableType() == QSurfaceFormat::OpenGLES)
+ if (m_format.renderableType() == QSurfaceFormat::OpenGLES) {
+ // unset LIBGL_ALWAYS_SOFTWARE now so other processes don't inherit it
+ if (forceSoftwareOpenGL)
+ qunsetenv("LIBGL_ALWAYS_SOFTWARE");
return;
+ }
m_context = glXCreateNewContext(DISPLAY_FROM_XCB(screen), config, GLX_RGBA_TYPE, m_shareContext, true);
if (!m_context && m_shareContext) {
@@ -287,8 +312,12 @@
window = createDummyWindow(screen, config);
} else {
// requesting an OpenGL ES context requires glXCreateContextAttribsARB, so bail out
- if (m_format.renderableType() == QSurfaceFormat::OpenGLES)
+ if (m_format.renderableType() == QSurfaceFormat::OpenGLES) {
+ // unset LIBGL_ALWAYS_SOFTWARE now so other processes don't inherit it
+ if (forceSoftwareOpenGL)
+ qunsetenv("LIBGL_ALWAYS_SOFTWARE");
return;
+ }
// Note that m_format gets updated with the used surface format
visualInfo = qglx_findVisualInfo(DISPLAY_FROM_XCB(screen), screen->screenNumber(), &m_format);
@@ -317,6 +346,10 @@
// Destroy our temporary window
XDestroyWindow(DISPLAY_FROM_XCB(screen), window);
+
+ // unset LIBGL_ALWAYS_SOFTWARE now so other processes don't inherit it
+ if (forceSoftwareOpenGL)
+ qunsetenv("LIBGL_ALWAYS_SOFTWARE");
+
return chosenConfig;
}
QGLXContext::~QGLXContext()