summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Add support for OpenGL ES 3.2 in QOpenGLExtraFunctionsLaszlo Agocs2017-06-303-6/+1076
| | | | | | | | | | | | | | | | | | | Follow the usual pattern: Add a config test and automatic include of GLES3/gl32.h if there is a GLES 3.2 capable header+lib at build time. Then, regardless of this being enabled, expose all new 3.2 API functions in QOpenGLExtraFunctions and resolve them dynamically at run time. This way 3.2 functions will be available when deployed to a 3.2 capable system (or OpenGL 3/4.x with the functions in question available) regardless of what was present in the sysroot at build time. Change-Id: Ia52551f3178591e1e56ceac8e45d89c6b13f4927 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add debug operator for QOpenGLTextureFriedemann Kleint2017-05-112-0/+46
| | | | | Change-Id: If87730725d9eba8d4c1e0158056cdeaa7c1bc12f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QOpenGLTexturePrivate::destroy(): Make error messages more verboseFriedemann Kleint2017-05-111-2/+11
| | | | | | | Distinguish missing and non-sharing contexts, output values. Change-Id: If52555098c1b46e6016e00f9dbbfad8e4b5d3a2d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Handle implicit close in QDashedStrokeProcessorAllan Sandfeld Jensen2017-05-021-2/+1
| | | | | | | | | Otherwise dashed polygons will not be closed when stroked like they are documented to be. Task-number: QTBUG-60397 Change-Id: I58e9e3a06af157f9a2789ccab640c9da75867962 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Don't use eglGetProcAddress() on AndroidPaul Olav Tvete2017-04-251-0/+568
| | | | | | | | | | | | Android 4.1 has a limitation on how many slots are available for eglGetProcAddress(). This reverts commit 7e393280e4d073930f5dd45881b68f4afbcab84e ("OpenGLES20 direct function call removed") for the Android platform only. Task-number: QTBUG-60318 Change-Id: I4a7224583e775143021735c037af07a95abbd6bf Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Update qopenglext.hLaszlo Agocs2017-04-221-74/+713
| | | | | | Change-Id: Ifb1d20855f0c0b9459d7ff2e01fbda1f713bff35 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Update qopengles2ext.hLaszlo Agocs2017-04-221-8/+1307
| | | | | Change-Id: I03b867133a00ef6e662a05d5eac7a733747fb8be Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: add missing specs about parametersNico Vertriest2017-04-181-0/+6
| | | | | | | | | qopengltexture.cpp:3476: warning: Undocumented parameter 'layerCount' in QOpenGLTexture::setCompressedData() and QOpenGLTexture::setData() qimage.cpp:2127: warning: Undocumented parameter 'format' in QImage::reinterpretAsFormat() Change-Id: I17feb2256a29f3bb722d2de3a83b390abff85a35 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Be more explicit about the supported platforms for OpenGL ES 2Jake Petroules2017-04-131-3/+3
| | | | | | | | The OpenGLES framework is only supported on iOS and tvOS, and does not exist on macOS and watchOS. Change-Id: I643d3bdac522b67a8d945648dfcc8f1780ab0d7f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Switch to RGB(A|X)8888[_Premultiplied] for QOpenGLFBO readbacks on GLESLaszlo Agocs2017-03-281-34/+9
| | | | | | | | | | | | | | | | | Instead of the never-ending blacklisting of "broken" drivers, simply switch to always choosing a byte ordered QImage format with OpenGL ES, and keep on using the (one and only) spec-mandated GL_RGBA/GL_UNSIGNED_BYTE combo. There is nothing broken with not supporting BGRA for glReadPixels even when GL_EXT_read_format_bgra (an out of date, pre-2.0 extension that got folded into the spec to begin with) is present. We do not have a good way to tell if BGRA_EXT is supported for glReadPixels or not, so just skip the whole problem altogether. Task-number: QTBUG-59283 Task-number: QTBUG-59303 Change-Id: I9f0605380923bd3b3ffdeb80f5c172d3e4cc7927 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-131-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network.pro mkspecs/features/mac/default_post.prf src/corelib/io/qfilesystemengine_win.cpp src/corelib/io/qprocess.cpp src/corelib/io/qprocess.h src/corelib/io/qprocess_p.h src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/corelib/thread/qmutex.cpp src/platformsupport/fontdatabases/windows/windows.pri src/plugins/platforms/eglfs/eglfsdeviceintegration.pro tests/auto/corelib/io/io.pro Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
| * Use QT_CONFIG(library) instead of QT_NO_LIBRARYUlf Hermann2017-03-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | For the windows file system engine, we add an extra macro to use library loading if configured to do so, but avoid it on WinRT, as none of the symbols would be found. We also QT_REQUIRE_CONFIG(library) in the library headers and exclude the sources from the build if library loading is disabled. This, in turn, makes it necessary to clean up some header inclusions. Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Fix malformed GL extension name for immutable storageLaszlo Agocs2017-03-011-1/+1
| | | | | | | | | | | | Change-Id: Ice2821d9d9523fa8cd446c009677378d52f61ad5 Task-number: QTBUG-59189 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | QtGui: kill some unneeded relocationsMarc Mutz2017-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Turn arrays of pointers into arrays of arrays. Results on optimized GCC 6.1.1 Linux AMD64 builds: text -264B data -512B relocs -43 Change-Id: I0b64615913d50c286596e66675e89758ce1ec2ba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use static initialization for QBasicAtomicsMarc Mutz2017-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | A default-constructed static QBasicAtomicInt at function scope will be dynamically initialized. It will still be zero-initialized, but at least GCC adds guard variables for such objects. When using aggregate initialization, the guard disappears. Amends 04d6495bf773a6bb0d4fa6980df22d3b81a605b0. Change-Id: Id9335cffdd43094cafb231fdde2523d013abe1d6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Make some atomic counters zero-basedMarc Mutz2017-02-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A variable of static storage duration that is not zero-initialized takes up space in the DATA segment of the executable. By making the counters start at zero and adding the initial value afterwards, we move them over to the BSS segment, which does not take up space in the executable. Wrap atomics used across function boundaries into small functions, to avoid code duplication and to increase readability. Change-Id: Ida6ed316ecb8fe20da62a9577161349e14de5aed Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | egl: Expose direct function pointers on INTEGRITYLaszlo Agocs2017-02-101-11/+10
| | | | | | | | | | | | Change-Id: I4f7df9abcd580297a40fd9dd16a26f5f93e1c4c7 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Fix compilation on iOSEskil Abrahamsen Blomfeldt2017-02-101-0/+2
| | | | | | | | | | | | | | | | | | The function is only used from inside the #ifndef ES2 blocks, causing it to fail compilation with a default configuration on iOS (where warnings are errors). Change-Id: I4f76c6371bd9125c7d1c919685df4a870eeb62f0 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-081-4/+0
|\| | | | | | | | | | | | | | | Conflicts: configure.json mkspecs/win32-icc/qmake.conf Change-Id: Ibf40546b024d644c7d9ed490bee15b82597f4d3f
| * Remove unused logging category from QOpenGLFunctionsLaszlo Agocs2017-01-311-4/+0
| | | | | | | | | | Change-Id: I54b533036f24ee9bd63004d1c5513f847e12065d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-301-1/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
| * Use context as glyph cache key in GL paint engineLaszlo Agocs2017-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch from ctx->shareGroup() to ctx. The original intention to use the same cache instance for sharing GL contexts is reasonable, but can only work when there are only shareable resources involved. The FBO used by QOpenGLTextureGlyphCache is not one of these. Text rendering in Qt Quick already uses the same approach and uses per-context glyph caches. Change-Id: Ie7e521769f28b4902ca714eb029acfbf52814309 Task-number: QTBUG-58276 Reviewed-by: Joni Poikelin <joni.poikelin@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Re-enable shader disk cache for IntegrityLaszlo Agocs2017-01-261-5/+0
| | | | | | | | | | | | | | Task-number: QTBUG-58183 Change-Id: Ic1be5db6922259cbef867720e95261d46a5ccaef Reviewed-by: Kimmo Ollila <kimmo.ollila@theqtcompany.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.8' into dev" into refs/staging/devLiang Qi2017-01-264-67/+72
|\ \
| * | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-254-67/+72
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/common/msvc-desktop.conf mkspecs/common/msvc-version.conf mkspecs/common/winrt_winphone/qmake.conf mkspecs/features/mac/default_post.prf mkspecs/features/mac/sdk.prf mkspecs/features/qt.prf mkspecs/features/uikit/default_post.prf mkspecs/features/winrt/default_pre.prf mkspecs/winphone-arm-msvc2013/qmake.conf mkspecs/winphone-x86-msvc2013/qmake.conf mkspecs/winrt-arm-msvc2013/qmake.conf mkspecs/winrt-x64-msvc2013/qmake.conf mkspecs/winrt-x86-msvc2013/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/gui/kernel/qwindowsysteminterface.cpp src/network/kernel/qhostaddress.cpp src/plugins/platforms/mirclient/qmirclientplugin.cpp src/plugins/platforms/mirclient/qmirclientplugin.h src/widgets/util/qsystemtrayicon.cpp tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp tools/configure/Makefile.mingw tools/configure/Makefile.win32 Done-with: Jake Petroules <jake.petroules@qt.io> Done-with: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Change-Id: I4be3262d3994e11929d3b1ded2c3379783797dbe
| | * Fix dereference before null check in QOpenGLExtensionMatcherJesus Fernandez2017-01-231-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | QOpenGLContext pointer was dereferenced before checking if it valid. Coverity-Id: 11370 Change-Id: I87d83a87d88ad7c055f3ed32096bfda036224ca9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | * Avoid trashing other contexts' VAOs in destroy()Laszlo Agocs2017-01-211-49/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following is safe: QOpenGLVertexArrayObject *vao = ... vao->create(); switch the current context delete vao; because the QOpenGLVAO dtor recognizes that the wrong context is current, and will temporarily restore the VAO's associated one in order to safely destroy the vao object. However, the following has been problematic: vao.create(); switch the current context vao.destroy(); simply because all the logic was in the dtor and destroy() blindly deleted the vao object in whatever context was current. This can lead to releasing a completely unrelated vao object that happens to have the same name in another context. The expectation is for context-dependent wrappers is that a ctor-create-dtor-ctor-create-dtor-... sequence is equivalent to create-destroy-create-destroy-..., so move the safe cleanup logic from the dtor to destroy(). Change-Id: Ie3bddbf4bfeb8629948c4783cc88422c9df03e65 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Make sure we call glClearDepth(double) on desktop GLGunnar Sletta2017-01-191-2/+3
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-56798 Change-Id: I028510c0f75df5c7d2dce539c32ea503009467db Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Bruno de Oliveira Abinader <brunoabinader@gmail.com>
| | * Fix deleting of QOpenGLVersionFunctionsBackendDavid Faure2017-01-061-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the destructor is not virtual we need to cast to the proper class when deleting otherwise the wrong destructor is called and the object memory is not entirely freed. Change-Id: Ie4e0e91bfa6e802c7d72fd1f137f5c7f3f31c8a0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Align blob start in program binary disk cacheLaszlo Agocs2017-01-241-48/+88
|/ / | | | | | | | | | | | | | | | | | | | | | | Make INTEGRITY happy. While we are at it, clean up the way the data is composed and accessed and avoid unaligned uint32* accesses on our side as well. Task-number: QTBUG-58183 Change-Id: I357be4b6844e5e8b8d27261a3676e135faea6250 Reviewed-by: Kimmo Ollila <kimmo.ollila@theqtcompany.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Add support for OpenGL 3.2+ core profile contexts in QPainterJulian Thijssen2017-01-235-101/+726
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows painting via QPainter onto a QOpenGLWindow, QOpenGLWidget or QOpenGLFramebufferObject when an core profile context is in use. This is important on macOS in particular, where compatibility profiles are not available, and so the only way to use modern OpenGL is via a core profile context. Added core profile compatible shaders with moder GLSL keywords. The paint engine binds a VAO and two VBOs from now on, whenever VAOs are supported. Note that this changes behavior also for OpenGL 2.x context that have VAO support via extensions. The Lancelot test suite gains support for core profile contexts. This can be triggered via -coreglbuffer in place of -glbuffer when manually inspecting via 'lance', while tst_lancelot will automatically run core context-based tests whenever supported. Task-number: QTBUG-33535 Change-Id: I6323a7ea2aaa9e111651ebbffd3e40259c8e7a9c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Remove OpenGL dependency from qTriangulateLaszlo Agocs2017-01-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original implementation is only suitable as long as the only client is the GL paint engine which will call the function with the GL context current. In other cases this cannot be ensured. For instance, doing triangulation on the gui thread in a Quick application using the threaded render loop will have to deal with not having a current context on that thread at all. Doing triangulation on worker threads has the same problem as well. In addition, in modern Qt versions a -no-opengl build does not imply no accelerated graphics API. Therefore, drop the ElementIndexUint check from qtriangulator.cpp and leave it up to the caller to tell if uint indices are supported or not. Change-Id: I7491d84981ee22d05c5fde08994dbb3a4e2432e9 Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
* | Add eglfs-viv support for INTEGRITYKimmo Ollila2017-01-181-0/+5
| | | | | | | | | | | | | | Change-Id: I5ea23eeac930dcc628047e3322061d543bddb643 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
* | Remove qtypetraits.h's contents altogetherGiuseppe D'Angelo2017-01-122-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that QFlags can use an (un)signed int matching the underlying type as identified by the compiler and not by us. Requires fixing a few warnings about sign conversion due to QFlags misusages in qtbase that were either plain wrong, or were relying on the enum being backed by an (un)signed int when it wasn't. Keep qtypetraits.h in the source tree in order to prevent source breaks if some downstream #includes it (note however that it did not contain any public API). Change-Id: Ib3a92b98db7031e793a088fb2a3b306eff4d7a3c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add new APIs which is useful to upload more than one layer at onceBogDan Vatra2017-01-043-26/+75
| | | | | | | | | | | | | | | | | | It's useful to upload textures storred in .KTX files without dividing the layers. It's also more efficient than uploading layer by layer. Change-Id: I92d93c57514e2a3637d1202cb83bd72b8d277edf Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Suppress QOpenGLShaderProgram::link() warnings for binariesLaszlo Agocs2016-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | No need to pollute the debug output when attempting to load a program binary which then gets rejected, because this is not fatal. We will simply recompile from source then. Change-Id: I762b7c66fc1ccdf8ab73d720ee10a349c287628b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-161-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure configure.pri examples/widgets/painting/fontsampler/mainwindow.cpp examples/widgets/painting/fontsampler/mainwindow.h mkspecs/features/moc.prf src/corelib/global/qglobal.h src/gui/text/qtextdocument.cpp Change-Id: Ica65512e00871695190a14ccea5c275b0165f787
| * Merge remote-tracking branch 'origin/5.8.0' into 5.8Liang Qi2016-12-161-3/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/plugins/platforms/android/qandroidplatformopenglcontext.h src/plugins/platforms/android/qandroidplatformtheme.h Change-Id: I13d51cc66f708138ff4d667ceea7d515992e58a4
| | * Merge remote-tracking branch 'origin/5.7' into 5.8.0Liang Qi2016-12-081-3/+3
| | |\ | | | | | | | | | | | | Change-Id: I576187a9905802c177ae483e6c29d0f55cf7034d
| | | * QtGui: Add missing overrideAlexander Volkov2016-11-271-3/+3
| | | | | | | | | | | | | | | | | | | | Change-Id: Ief5b0863d7649d5a8d421c05766513276c264776 Reviewed-by: hjk <hjk@qt.io>
* | | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-12-135-456/+198
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/Makefile.unix.macos qmake/Makefile.unix.win32 qmake/generators/win32/msvc_vcproj.cpp src/3rdparty/pcre/qt_attribution.json src/corelib/io/qsettings.cpp src/corelib/kernel/qdeadlinetimer.cpp src/platformsupport/kmsconvenience/qkmsdevice.cpp src/platformsupport/kmsconvenience/qkmsdevice_p.h src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldevicescreen.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsdevice.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/qeglfskmsscreen.h tests/manual/qstorageinfo/printvolumes.cpp tools/configure/configureapp.cpp Change-Id: Ibaabcc8e965c44926f9fb018466e8b132b8df49e
| * | | Add ASTC compressionBogDan Vatra2016-12-032-0/+198
| |/ / | | | | | | | | | | | | Change-Id: I7ae3b02579eb844f109c25a0dd5467748813a558 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * | Remove last traces of MeeGoLars Knoll2016-11-233-456/+0
| | | | | | | | | | | | | | | | | | Change-Id: I5242f1dfcfccf9811398e717b90196e6228d1dc5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | doc: Always declare GL types for clangqdocMartin Smith2016-12-032-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | GLint, GLuint, GLfloat, and GLenum must be declared for clangqdoc because it must generate the documentation for opengl support whether or not opengl support is provided. Change-Id: I1dccac86fe72a30509bc563dda0b60bcb156bc0b Reviewed-by: Martin Smith <martin.smith@qt.io>
* | | qopenglprogrambinarycache_p.h: Add "We mean it" commentFriedemann Kleint2016-11-251-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix QtGui: WARNING: qtbase/src/gui/opengl/qopenglprogrambinarycache_p.h does not have the "We mean it." warning Amends change 85f868e73e4cf9dffe27b737f8dc3f5bb626ed04. Change-Id: Id2e8c3e7ac4fa732c0a3d99faab91f08121fba96 Task-number: QTBUG-55496 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Use QSaveFile for more robust shader disk cacheLaszlo Agocs2016-11-251-4/+8
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-55496 Change-Id: Ie9bd4390e7bb7bf22dbe597a6a01fecec7a6b404 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add an OpenGL program binary disk cacheLaszlo Agocs2016-11-249-88/+776
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a glProgramBinary-based disk cache in QOpenGLShaderProgram. By switching the typical program->addShaderFromSourceCode(QOpenGLShader::Vertex, ...) program->addShaderFromSourceCode(QOpenGLShader::Fragment, ...) invocations to program->addCacheableShaderFromSourceCode(QOpenGLShader::Vertex, ...) program->addCacheableShaderFromSourceCode(QOpenGLShader::Fragment, ...) the compilation may be skipped via gl(Get)ProgramBinary and a disk cache, when supported. Such QOpenGLShaderProgram instances will have no QOpenGLShader instances attached. Instead, the entire program binary (which is driver-specific) is loaded as-is. Support means OpenGL ES 3.0 or the presence of GL_ARB_get_program_binary, in combination with >= 1 supported binary formats. Note that some drivers claim program binary support but expose no formats. This amounts to no support in practice. When support is not present, calling the new functions is equivalent to the non-cacheable variants. If the OpenGL driver changes (vendor, renderer, version strings), recompilation and storage of the new, potentially incompatible binary program will happen transparently. The cache can always be disabled by setting QT_DISABLE_SHADER_DISK_CACHE=1 or the new application attribute Qt::AA_DisableShaderDiskCache. Location-wise the primary choice is the shared cache (GenericCacheLocation). If this is not available or is not writable, the per-process one (CacheLocation) is used instead. In addition to the new public APIs in QOpenGLShaderProgram, the main shader users in QtGui are migrated as well. (OpenGL paint engine, glyph cache, blitter, eglfs mouse cursor). This means that any application using QPainter on OpenGL or widgets with eglfs will benefit from the improved startup times. Qt Quick will follow suit as well. [ChangeLog][QtGui][OpenGL] QOpenGLShaderProgram offers a built-in program binary disk cache for systems with OpenGL ES 3.x or GL_ARB_get_program_binary. This can lead to significant increases in performance when it comes to application startup times for example. Usage is opt-in for direct C++ users of the class, however Qt's own main users of shaders, including Qt Quick and QPainter's OpenGL engine, are migrated to use the new, cache-enabled APIs. Opting out on application level is always possible via Qt::AA_DisableShaderDiskCache. Task-number: QTBUG-55496 Change-Id: I556f053d258bfa6887b1d5238c9f6396914c5421 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-11-175-40/+73
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/mac/default_post.prf mkspecs/features/uikit/default_post.prf Change-Id: I2a6f783451f2ac9eb4c1a050f605435d2dacf218
| * | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-162-1/+23
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/common/linux-android.conf src/gui/opengl/qopengl.h src/network/socket/qnativesocketengine_winrt.cpp src/network/socket/qnativesocketengine_winrt_p.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/api/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp sync.profile Change-Id: If70aaf2c49df91157b864cf0d7d9513546c9bec4
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-152-1/+27
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/plugins/platforms/eglfs/qeglfsintegration.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp Change-Id: Id2da7c775439adb62646d5b741ee7c638042b34b