summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglfunctions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtGui: use printf-style qWarning/qDebug where possible (I)Marc Mutz2016-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "..."; with qWarning("..."); In QTransform shared warning strings. Saves 3KiB in text size on optimized GCC 5.3 AMD64 builds. Change-Id: I142a8020eaab043d78465178192f2c8c6d1cc4f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* CleanupsLars Knoll2016-03-011-39/+27
| | | | | | | | | | Remove the different flags when trying to resolve opengl functions. Rather we simply try hard to find a matching method by resolving over possible suffixes when we can't find the standard name. Change-Id: Ic73085faec3bd406f5214ed4219eb7b796651d8d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Generate more compact code to resolve the QOpenGLExtraFunctionsLars Knoll2016-03-011-193/+9
| | | | | | | | Similar to the parent commit, this reduces binary size significantly. Change-Id: Idd6753ec5e04ec84d93bf6f86b5c71550b90ae9b Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Generate more compact code to resolve the QOpenGLFunctionsLars Knoll2016-03-011-232/+38
| | | | | | | | | Use a similar mechanism as in QOpenGLVersionFunctions and resolve the methods in a loop. This requires some macro magic but significantly reduces the size of the generated code. Change-Id: If5f5e5551af0d1aed4b4ce7ce82932d8988dab59 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Remove some now unused codeLars Knoll2016-03-011-346/+2
| | | | | | | | The old Resolver class to resolve GL symbols is not being used any longer, get rid of it. Change-Id: I835860eb1c42aea05458ca32cf652659500312da Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Get rid of the gles3helper classLars Knoll2016-03-011-636/+175
| | | | | | | | | Since the backends can now resolve all possible GL functions, there's no need for the special handling for GLES that this class did anymore. Change-Id: Ib48aecc9a892f3c883d76ffc82217f346dbb3adc Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Resolve GLES3 function pointers at construction timeLars Knoll2016-03-011-1586/+363
| | | | | | | | | | | | Remove the wrapper methods resolving themselves at first run also here and instead resolve all GL entry points when the QOpenGLExtraFunctions object gets constructured. Keep the gles3helper for now until all backends are fixed to be able to resolve these methods directly. Change-Id: I194bd4465605f57d27c79808a016592c101ac04c Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Avoid repeated QByteArray creation when resolving opengl functionsLars Knoll2016-03-011-26/+29
| | | | | | | | | | Add an getProcAddress(const char *) overload to QOpenGLContext, and refactor the QPA interface to take a const char *. Like this we can avoid lots of mallocs when resoving GL methods. Change-Id: Ic45b985fbaa0da8d32ba3e3b485351173352ca6f Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Simplify part of the resolving code in QOpenGLFunctionsLars Knoll2016-03-011-852/+170
| | | | | | | | | | | | | Directly resolve the GL symbols in the constructor instead of wrapping them in another method that resolves on first call. Simplifies the code and reduces the the size of QtGui by around 50k. Change-Id: If1fc575d0113d3d9b48ad1918429254c827e42c7 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* De-inline the code resolving the GL symbolsLars Knoll2016-03-011-19/+41
| | | | | | | | Saves around 200k in QtGui.so. Change-Id: I1a020445093a5612ed64ca98bf51435580478cda Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/devLiang Qi2016-01-261-1/+1
|\
| * Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-211-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice_p.h src/corelib/kernel/qvariant_p.h src/corelib/tools/qsimd.cpp src/gui/kernel/qguiapplication.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp Change-Id: I742a093cbb231b282b43e463ec67173e0d29f57a
| | * Doc: add missing semi-colonThiago Macieira2016-01-151-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I408dcb81ba654c929f25ffff14291c57198e7367 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | | Remove support for old/deprecated gl function namesLars Knoll2016-01-261-46/+17
|/ / | | | | | | | | | | | | These are nowadays standardized. Change-Id: I3931859bba0b4c34a9336c7f537e3093e07d9b2d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-3/+3
|/ | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Doc: Fix QDoc warnings for QOpenGLFunctions and QOpenGLExtraFunctionsTopi Reinio2015-08-261-75/+90
| | | | | | | | | | | | - Use \a commands when listing the arguments for OpenGL methods - Document functions taking a single argument of type 'void' verbatim. Otherwise, QDoc refuses to generate their docs - Add constructor docs for QOpenGLExtraFunctions (copied from QOpenGLFunctions). Change-Id: I64a436365572a80319ba0a8eaba2f5d9b751e84d Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Support MRT in QOpenGLFramebufferObjectLaszlo Agocs2015-07-291-5/+7
| | | | | | | | | | | | Introduce overloads in the API to allow specifying multiple color attachment sizes and formats. When these are in use and MRT is supported, a texture or renderbuffer is created for each of GL_COLOR_ATTACHMENT0, 1, 2, ... [ChangeLog] Added support for multiple render targets in QOpenGLFramebufferObject Task-number: QTBUG-39235 Change-Id: Ie7cfd81d1b796a9166b80dff7513aafe0120d53d Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Expose GLES 3.0 and 3.1 functionsLaszlo Agocs2015-07-231-125/+4129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the approach we already do for some GLES 3.0 functions we can provide a cross-platform, cross-GL-GLES wrapper for ES 3.0 and 3.1 functions too. Applications only have to take extra care about the version requests (context version and version directives in shader code), the rest of their code can stay the same across desktop/mobile/embedded, even when ES 3 functions are used. The new functions are placed to a new subclass which is placed between QOpenGLFunctions and the internal QOpenGLExtensions. This is necessary because, unlike with QOpenGLFunctions, there is no guarantee that these functions are always available in all configurations. When running on desktop OpenGL, we resolve as usual. If the OpenGL version contains the function in question, either in core or as an extension, it will all just work. This is handy because it does not rely on 4.x extensions like GL_ARB_ESx_compatibility, and so ES 3.0 functions will be functional on OpenGL 3.x systems too by just setting a 3.x version number in the QSurfaceFormat. We will no longer qFatal on broken systems where the driver returns a 3.0 or 3.1 context without the corresponding functions present. Instead, we show a warning and gracefully fall back to resolving as usual, via eglGetProcAddress or similar. For functions that are available in ES2 as an extension this may just work fine. Added also an example that runs identically both with OpenGL and OpenGL ES 3 and utilizes some ES 3.0 features like instanced drawing. [ChangeLog] Added QOpenGLExtraFunctions providing OpenGL ES 3.0 and 3.1 function wrappers in a cross-platform manner. Task-number: QTBUG-46161 Change-Id: I9f929eb61946c35c415b178c4d6ab2c1c958684e Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-2/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * Do not claim TextureRGFormats on Mesa with GLESLaszlo Agocs2015-06-221-2/+6
| | | | | | | | | | | | | | | | | | Mesa provides GL ES 3.0 so using GL_RED in place of GL_ALPHA should work. This is apparently not the case. Task-number: QTBUG-46605 Change-Id: I4f661487b47e9cc11f5de110196ec37150c99c7f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| * Fix gles lib loading on AndroidLaszlo Agocs2015-06-161-0/+4
| | | | | | | | | | | | | | | | | | Setting the version breaks on Android as it has no .so versions, leading to aborting apps on devices that support GLES 3.x. Change-Id: Id4381e08a2615a0898def8f075ce5a5c5b9c7a7d Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * Load GLESv2 library with correct major versionJaeyoon Jung2015-06-081-1/+1
| | | | | | | | | | | | | | | | | | Make sure GLESv2 library to be loaded even when the symlink of .so is not installed. Change-Id: Ie7c810a137cebc7fa59612830e3643861b532fdb Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Do not use 16 bits per color on GLESLaszlo Agocs2015-06-291-2/+5
| | | | | | | | | | | | | | unless GL_EXT_texture_norm16 (and so GL_RGBA16) is present. Change-Id: Ic15b81b8134fda147e96301b7f78cabe07a05d9e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Don't try to load opengl extensions or functions without QLibraryUlf Hermann2015-06-121-2/+7
|/ | | | | Change-Id: If77ca6e04c83d94fd3063b68963b1bcd90980d99 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Fix GLES3 functions on iOSLaszlo Agocs2015-05-181-24/+46
| | | | | | | Task-number: QTBUG-45933 Change-Id: I784e34c1cfee5ea69955c221f0448c1d04e0b6d7 Reviewed-by: jian liang <jianliang79@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Make data tables const.Volker Krause2015-05-051-1/+1
| | | | | | | | | | Moves some of them to the .rodata section, the rest at least to .data.rel.ro[.local]. Change-Id: I85676ddf22b0c0097f3f0dce4c3dc018dc29d045 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Use glFinish() in QOpenGLWidget unless glFlush() is known to be enoughLaszlo Agocs2015-03-231-1/+31
| | | | | | | | | | | | | | | | | | | | The driver used on the Odroid-XU3 does not like doing just glFlush() before accessing the texture in another context. There is no guarantee that glFlush() is enough to sync access to resources between contexts, so start using glFinish() as the default, except on common desktop hw + iOS where flush is enough and presumably more efficient. To unify the code pathes, remove the separate flushes and do it only once, before the backingstore compositor indicates that it is about to access the textures. This should improve performance a bit, esp. when doing multisampling since we flush only once then. A helper function is added to the internal QOpenGLExtensions because it is highly likely that QQuickWidget will need the same. Task-number: QTBUG-45106 Change-Id: Ifb405c5723f29f2f6c04df8e15fb70280681755e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Prevent crashing on ES2 SDK - ES3 device scenarios with AndroidLaszlo Agocs2015-02-121-1/+4
| | | | | | | | | | | | | | Making a build with an older NDK having only gl2.h results in crashing QOpenGLTexture on devices that provide ES 3.0 or 3.1. This is because immutable storage is supported (based on runtime checks) but the function pointers are not there (due to ifdef checks). Fix this like we did in other places: get rid of the ifdef and dlsym the ES3-only symbols. Task-number: QTBUG-44397 Change-Id: Ief518ec8c7d532aeea0075ba166baf8d22e66ec5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-101-27/+72
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * Resolve GLES3 functions from the shared libLaszlo Agocs2015-01-101-27/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately the few functions that are part of the OpenGL ES 3.0 standard and are used by QtGui have to have special handling after all. Just directly calling the functions causes issues when building on a GLES3 capable system and deploying somewhere where only GLES2 is available. Using eglGetProcAddress and such is not an option because the ES spec does not guarantee that standard functions are resolvable via that mechanism. Task-number: QTBUG-43318 Change-Id: I72f985d75ca669835839016573cbb8e4a3fb41db Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Add GL_EXT_discard_framebuffer to QOpenGLExtensionsJørgen Lind2014-12-111-0/+9
| | | | | | | | | | Change-Id: I57e8dd2ea2e6f018a46eaabed2ca8b6d417358a3 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-031-2/+2
| | | | | | | | | | | | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Support Alpha8 and Grayscale8 natively in the OpenGL paint engineAllan Sandfeld Jensen2014-10-271-1/+4
|/ | | | | | | | | Adds special shaders for the Alpha8 and Grayscale8 formats so that they do not need to rely on the support of GL_ALPHA and GL_LUMINANCE that has been removed from core in recent OpenGL versions. Change-Id: Ie370379b458abf2a50e252bc5099aefc1b11fb1d Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Pass a sized format when creating multisampled renderbuffers on ESLaszlo Agocs2014-10-031-4/+8
| | | | | | | Task-number: QTBUG-40921 Change-Id: I96b05442dd5928992dab06553b3d41feca89084d Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Code cleaning in qt_gl_resolve_extensionsAllan Sandfeld Jensen2014-08-281-34/+42
| | | | | | | | | Moves feature checks so OpenGL vs OpenGLES is only tested one way and extensions so they are not tested if already required by their version. Change-Id: Ia77f6ea924559fa7a428beb6316ae392063dfc4f Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Add support for glMapBufferRange in the wrappers and resolversLaszlo Agocs2014-08-081-1/+30
| | | | | | | | | | | | | | QOpenGLBuffer::map() and related helpers are becoming useless in OpenGL ES 3.0 and up: instead of the old GL_OES_map_buffer, glMapBufferRange, but not glMapBuffer, is now part of the standard. On desktop GL_ARB_map_buffer_range is present by default in OpenGL 3.0 and newer. [ChangeLog][QtGui] Added QOpenGLBuffer::mapBufferRange(). Task-number: QTBUG-38168 Change-Id: I4e9bbe8ced9ee4d535ac32849a8c08c26d79cb49 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Do not use GLES3 functions in a GLES2 contextLaszlo Agocs2014-08-071-6/+8
| | | | | | | | | | Just like the recent fix for VAOs on iOS, where we might deploy a GLES3-enabled binary on a GLES2-only system, the same issue is potentially present for blitFramebuffer and renderbufferStorageMultisample. Handle this properly. Change-Id: I87268478f1de479dc2c106b46d6e9b84e866fcd5 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Update QOpenGLFunctions docsLaszlo Agocs2014-08-011-0/+12
| | | | | | | | | | | Mention QOpenGLContext::functions() which is used quite commonly in Qt itself and also some examples. Also, make it clear that new instances do not degrade performance since function resolving is done only once. Change-Id: I74ac194a0b3956a70e5078dd5a1bcdd277b5cc28 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-011-38/+40
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/network/socket/qnativesocketengine_winrt.cpp src/plugins/platforms/android/androidjniaccessibility.cpp src/plugins/platforms/windows/qwindowswindow.cpp Manually adjusted: mkspecs/qnx-armle-v7-qcc/qplatformdefs.h to include 9ce697f2d54be6d94381c72af28dda79cbc027d4 Thanks goes to Sergio for the qnx mkspecs adjustments. Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
| * Properly check which OpenGL features are supportedMartin Gräßlin2014-06-201-38/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLShaderProgram::hasOpenGLShaderPrograms tests whether QOpenGLFunctions::Shaders is provided for the given context. As the initialization code assumed OpenGL 2 this always was true. But unfortunately we still cannot assume that OpenGL 2 is universally supported. E.g. indirect rendering (no matter how bad that idea is) does not support OpenGL 2 on all hardware and the Shader related extensions are not available. This change makes sure that only when OpenGL 2 is available the features provided by OpenGL 2 are enabled. If OpenGL 2 is not available the extensions are tested. The checks are slightly reordered to not do the extension tests at all if OpenGL 2 is available. Task-number: QTBUG-39730 Change-Id: Ic775163e0dcc519925b1287f3c4ca5e8ebf101d5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Support framebuffer blit and msaa without extensions on GLES3Laszlo Agocs2014-06-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call the standard functions directly in GLES 3.0+ builds. The catch here, just like with the mapBuffer changes, is that we could, in theory, dynamically load a GLES3 implementation on the !QT_OPENGL_ES_3 path too. However this is limited to Windows currently and we don't have a full GLES3 stack there (yet), and even when we do get it, the ANGLE extensions for blit and multisampling will still work. Therefore this isn't really an issue for now. Task-number: QTBUG-38168 Task-number: QTBUG-39187 Change-Id: I343a737218c9fe438ee1603b37e93f0400d952a5 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Enhance msaa and blitframebuffer on ES with vendor extensionsLaszlo Agocs2014-06-251-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | The support already in place for ANGLE is now extended for NV. On ES 2.0 the only way to get multisampled renderbuffers and blitframebuffer is through vendor-specific extensions. QOpenGLFunctions is updated to resolve the related functions for both ANGLE and NV, in addition to EXT. Task-number: QTBUG-39187 Change-Id: I1aab805ced3d06dde3dc547221bbf833ff8e06c2 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Include the ES3 headers on iOSLaszlo Agocs2014-06-251-0/+6
|/ | | | | | | | | | The config test correctly recognizes if GLES 3.0 is available, however qopengl.h still includes the ES2 headers. This causes issues for the new GLES3 support patches. Change-Id: Ia97f556cc207f7d828918f493fe1adab93cf31ec Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Fall back to ANGLE BlitFramebuffer and RenderbufferStorageMultiSampleAndrew Knight2014-05-221-2/+6
| | | | | | | | | When these extensions aren't available, use ANGLE's versions of them. Task-number: QTBUG-31010 Change-Id: I9a85b9f4d2bb60bdb1d79c92edf241b95d0627bf Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Rename new QOpenGLContext APIsLaszlo Agocs2014-04-251-4/+4
| | | | | | | | | | | | | | isES() becomes isOpenGLES(). The library type enums are changed DesktopGL -> LibGL and GLES2 -> LibGLES. This removes the now unnecessary version number, the confusing "desktop" term and provides better readability. The old function/values are kept until the related qtdeclarative changes are integrated. Task-number: QTBUG-38564 Change-Id: Ibb0a1209985f1ce4bb9451f9b7b093c2b68a6505 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLFunctions: Compile on Mac OS 10.6Morten Johan Sørvig2014-04-241-1/+5
| | | | | | | | | | | | The 10.6 OpenGL headers have "GLenum" as the type for the 3rd argument. The OpenGL standard has "Glint", which is also what Qt expects. Work around this by casting the pointer type. Task-id: QTBUG-38406 Change-Id: I6d820f41e0d14cbc2d50d91997b6c40b626b159f Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Remove internal public function from QOpenGLFunctionsLaszlo Agocs2014-04-171-23/+2
| | | | | | | | | | | | | | QOpenGLContext uses glGetTexLevelParameteriv on desktop OpenGL and so it got recently added to QOpenGLFunctions as part of the dynamic GL loading support. This is unnecessary since such desktop-only code can use the versioned wrappers (QOpenGLFunction_1_0 for example). In related upcoming changes in 5.4 the function is removed. This change has to be backported to 5.3 to prevent introducing this public API unnecessarily. Change-Id: I6fc331091e4e6416e430bf985afcc17a392fc2e3 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>