qt5base-lts/mkspecs
Laszlo Agocs 97c187da3c Dynamic GL switch on Windows
The patch introduces a new build configuration on Windows which
can be requested by passing -opengl dynamic to configure.

Platforms other than Windows (including WinRT) are not affected.
The existing Angle and desktop configurations are not affected.
These continue to function as before and Angle remains the default.

In the future, when all modules have added support for the dynamic
path, as described below, the default configuration could be changed
to be the dynamic one. This would allow providing a single set of
binaries in the official builds instead of the current two.

When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are
never defined. Instead, the code path that has traditionally been
desktop GL only becomes the dynamic path that has to do runtime
checks. Qt modules and applications are not linked to opengl32.dll or
libegl/glesv2.dll in this case. Instead, QtGui exports all necessary
egl/egl/gl functions which will, under the hood, forward all requests
to a dynamically loaded EGL/WGL/GL implementation.

Porting guide (better said, changes needed to prepare your code to
work with dynamic GL builds when the fallback to Angle is utilized):

1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to
differentiate between desktop and ES where needed. Keep in mind that
it is the desktop GL header (plus qopenglext.h) that is included,
not the GLES one.

QtGui's proxy will handle some differences, for example calling
glClearDepth will route to glClearDepthf when needed. The built-in
eglGetProcAddress is able to retrieve pointers for standard GLES2
functions too so code resolving OpenGL 2 functions will function
in any case.

2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds,
but never "angle" or "opengles2".

3. The preprocessor define QT_OPENGL_DYNAMIC is also available in
dynamic builds. The usage of this is strongly discouraged and should
not be needed anywhere except for QtGui and the platform plugin.

4. Code in need of the library handle can use
QOpenGLFunctions::platformGLHandle().

The decision on which library to load is currently based on a simple
test that creates a dummy window/context and tries to resolve an
OpenGL 2 function. If this fails, it goes for Angle. This seems to work
well on Win7 PCs for example that do not have proper graphics drivers
providing OpenGL installed but are D3D9 capable using the default drivers.

Setting QT_OPENGL to desktop or angle skips the test and forces
usage of the given GL. There are also two new application attributes
that could be used for the same purpose.

If Angle is requested but the libraries are not present, desktop is
tried. If desktop is requested, or if angle is requested but nothing
works, the EGL/WGL functions will still be callable but will return 0.
This conveniently means that eglInitialize() and such will report a failure.

Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will
tell which implementation is chosen.

The textures example application is ported to OpenGL 2, the GL 1
code path is removed.

[ChangeLog][QtGui] Qt builds on Windows can now be configured for
dynamic loading of the OpenGL implementation. This can be requested
by passing -opengl dynamic to configure. In this mode no modules will
link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will
dynamically choose between desktop and Angle during the first GL/EGL/WGL
call. This allows deploying applications with a single set of Qt libraries
with the ability of transparently falling back to Angle in case the
opengl32.dll is not suitable, due to missing graphics drivers for example.

Task-number: QTBUG-36483
Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-02-14 10:51:44 +01:00
..
aix-g++ Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
aix-g++-64 Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
aix-xlc Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
aix-xlc-64 Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
android-g++ Prepare for printing support. 2013-11-23 15:46:19 +01:00
blackberry-armle-v7-qcc Rename BlackBerry arm mkspecs to be aligned with NDK structure 2013-10-23 19:09:54 +02:00
blackberry-armv7le-qcc Rename BlackBerry arm mkspecs to be aligned with NDK structure 2013-10-23 19:09:54 +02:00
blackberry-x86-qcc BlackBerry mkspecs: optimize linker flags 2012-11-26 15:11:59 +01:00
common Merge remote-tracking branch 'origin/stable' into dev 2014-02-07 13:07:25 +01:00
cygwin-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
darwin-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
devices eglfs: Remove unused variable on raspi 2014-01-24 11:33:00 +01:00
features Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2014-02-11 15:12:00 +01:00
freebsd-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
freebsd-g++46 Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
freebsd-icc Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
hpux-acc Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
hpux-acc-64 Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
hpux-acc-o64 Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
hpux-g++ Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
hpux-g++-64 Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
hpuxi-acc-32 Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
hpuxi-acc-64 Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
hpuxi-g++-64 Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
hurd-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
irix-cc expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
irix-cc-64 expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
irix-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
irix-g++-64 Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
linux-arm-gnueabi-g++ Add QMAKE_NM to the mkspecs 2013-06-10 16:46:06 +02:00
linux-clang expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
linux-clang-libc++ Add mkspec for clang using libc++ on Linux. 2013-12-09 22:23:59 +01:00
linux-cxx expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
linux-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
linux-g++-32 Fix '=' alignment and replace tabs in *.conf (whitespace only change) 2013-03-27 17:16:37 +01:00
linux-g++-64 Fix '=' alignment and replace tabs in *.conf (whitespace only change) 2013-03-27 17:16:37 +01:00
linux-g++-maemo Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
linux-icc Merge remote-tracking branch 'origin/stable' into dev 2014-02-12 16:28:07 +01:00
linux-icc-32 Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
linux-icc-64 Fix '=' alignment and replace tabs in *.conf (whitespace only change) 2013-03-27 17:16:37 +01:00
linux-kcc expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
linux-llvm expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
linux-lsb-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
linux-pgcc expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
lynxos-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
macx-clang qmake: Pick up default bundle prefix from Xcode preferences 2013-10-31 12:33:55 +01:00
macx-clang-32 qmake: Pick up default bundle prefix from Xcode preferences 2013-10-31 12:33:55 +01:00
macx-g++ qmake: Pick up default bundle prefix from Xcode preferences 2013-10-31 12:33:55 +01:00
macx-g++40 qmake: Pick up default bundle prefix from Xcode preferences 2013-10-31 12:33:55 +01:00
macx-g++42 qmake: Pick up default bundle prefix from Xcode preferences 2013-10-31 12:33:55 +01:00
macx-g++-32 qmake: Pick up default bundle prefix from Xcode preferences 2013-10-31 12:33:55 +01:00
macx-icc qmake: Pick up default bundle prefix from Xcode preferences 2013-10-31 12:33:55 +01:00
macx-ios-clang Explicitly use libstdc++ for non-C++11 static builds 2014-01-28 02:33:40 +01:00
macx-llvm qmake: Pick up default bundle prefix from Xcode preferences 2013-10-31 12:33:55 +01:00
macx-xcode macx-xcode: Change wrapper to write to QMAKESPEC to change mkspec 2013-10-14 12:07:53 +02:00
modules update readme to current reality 2012-01-27 13:55:27 +01:00
netbsd-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
openbsd-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
qnx-armv7le-qcc QNX: Make use of _readdir64_r 2013-11-25 18:15:35 +01:00
qnx-x86-qcc QNX: Make use of _readdir64_r 2013-11-25 18:15:35 +01:00
sco-cc expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
sco-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
solaris-cc expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
solaris-cc-64 expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
solaris-cc-64-stlport Fix '=' alignment and replace tabs in *.conf (whitespace only change) 2013-03-27 17:16:37 +01:00
solaris-cc-stlport Fix '=' alignment and replace tabs in *.conf (whitespace only change) 2013-03-27 17:16:37 +01:00
solaris-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
solaris-g++-64 expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
tru64-cxx expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
tru64-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
unixware-cc expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
unixware-g++ expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
unsupported Add freebsd-clang mkspec 2014-01-22 12:46:14 +01:00
win32-g++ Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00
win32-icc Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00
win32-msvc2005 Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00
win32-msvc2008 Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00
win32-msvc2010 Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00
win32-msvc2012 Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00
win32-msvc2013 Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00
wince60standard-armv4i-msvc2005 Fix '=' alignment and replace tabs in *.conf (whitespace only change) 2013-03-27 17:16:37 +01:00
wince60standard-x86-msvc2005 Fix '=' alignment and replace tabs in *.conf (whitespace only change) 2013-03-27 17:16:37 +01:00
wince70embedded-armv4i-msvc2008 Remove not supported mkspecs for Windows CE. 2013-08-15 11:37:27 +02:00
wince70embedded-x86-msvc2008 Remove not supported mkspecs for Windows CE. 2013-08-15 11:37:27 +02:00
winphone-arm-msvc2012 WinRT: Provide qmake feature for generating a package manifest 2014-01-24 08:19:00 +01:00
winphone-x86-msvc2012 WinRT: Use correct architecture values in manifests and vs 2014-02-07 15:29:53 +01:00
winrt-arm-msvc2012 WinRT: Use correct architecture values in manifests and vs 2014-02-07 15:29:53 +01:00
winrt-arm-msvc2013 WinRT: Use correct architecture values in manifests and vs 2014-02-07 15:29:53 +01:00
winrt-x64-msvc2012 WinRT: Use correct architecture values in manifests and vs 2014-02-07 15:29:53 +01:00
winrt-x64-msvc2013 WinRT: Use correct architecture values in manifests and vs 2014-02-07 15:29:53 +01:00
winrt-x86-msvc2012 WinRT: Use correct architecture values in manifests and vs 2014-02-07 15:29:53 +01:00
winrt-x86-msvc2013 WinRT: Use correct architecture values in manifests and vs 2014-02-07 15:29:53 +01:00