From a26e3ecc3ddb407b204df629f2d1561d2293e0ea Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 23 Apr 2014 11:53:38 +0200 Subject: Include GLES 3.0 and 3.1 headers when available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In ES builds configure will now check for OpenGL ES 3.0 and 3.1 availability. This allows qopengl.h to include the correct header and, by defining QT_OPENGL_ES_3 and QT_OPENGL_ES_3_1, the OpenGL wrappers can provide support for MapBuffer, VAOs, etc. on GLES 3.0+ too. Right now this is not possible since the only standard way to use an ES function specific to a given version is to use the function directly. The extension mechanism (eglGetProcAddress and friends), that is often used in desktop GL, is not available for such functions. [ChangeLog][QtGui] QtGui's OpenGL headers are now automatically including the highest available header (gl31.h, gl3.h or gl2.h) in OpenGL ES builds. Task-number: QTBUG-38168 Change-Id: Ib857c58fe1696a9546fdd1aa143a9237e80325a5 Reviewed-by: Jørgen Lind Reviewed-by: Sean Harmer --- configure | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 9786d2e5e6..dbb47ff1b7 100755 --- a/configure +++ b/configure @@ -2484,7 +2484,7 @@ Additional options: -no-opengl .......... Do not support OpenGL. -opengl ....... Enable OpenGL support With no parameter, this will attempt to auto-detect - OpenGL ES 2, or regular desktop OpenGL. + OpenGL ES 2.0 and higher, or regular desktop OpenGL. Use es2 for to override auto-detection. * -no-system-proxies .. Do not use system network proxies by default. @@ -4675,7 +4675,7 @@ fi # X11/MINGW OpenGL if [ "$XPLATFORM_MINGW" = "yes" ]; then - # auto-detect OpenGL support (es2 = OpenGL ES 2.x) + # auto-detect OpenGL support (es2 = OpenGL ES 2.0 or higher) if [ "$CFG_GUI" = "no" ]; then if [ "$CFG_OPENGL" = "auto" ]; then CFG_OPENGL=no @@ -4689,7 +4689,7 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then if compileTest x11/opengl "OpenGL"; then CFG_OPENGL=desktop - elif compileTest unix/opengles2 "OpenGL ES 2.x"; then + elif compileTest unix/opengles2 "OpenGL ES 2.0"; then CFG_OPENGL=es2 else if [ "$CFG_OPENGL" = "yes" ]; then @@ -4715,8 +4715,8 @@ if [ "$XPLATFORM_MINGW" = "yes" ]; then ;; esac elif [ "$CFG_OPENGL" = "es2" ]; then - #OpenGL ES 2.x - compileTest unix/opengles2 "OpenGL ES 2.x" + #OpenGL ES 2.0 + compileTest unix/opengles2 "OpenGL ES 2.0" if [ $? != "0" ]; then echo "The OpenGL ES 2.0 functionality test failed!" echo " You might need to modify the include and library search paths by editing" @@ -4758,11 +4758,11 @@ if [ "$XPLATFORM_MAC" = "yes" ]; then fi fi -# auto-detect OpenGL support (es2 = OpenGL ES 2.x) +# auto-detect OpenGL support (es2 = OpenGL ES 2.0 or higher) if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then if compileTest unix/opengldesktop "OpenGL"; then CFG_OPENGL=desktop - elif compileTest unix/opengles2 "OpenGL ES 2.x"; then + elif compileTest unix/opengles2 "OpenGL ES 2.0"; then CFG_OPENGL=es2 else if [ "$CFG_OPENGL" = "yes" ]; then @@ -4775,7 +4775,7 @@ if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then CFG_OPENGL=no fi elif [ "$CFG_OPENGL" = "es2" ]; then - #OpenGL ES 2.x + #OpenGL ES 2.0 if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists glesv2 2>/dev/null; then QMAKE_INCDIR_OPENGL_ES2=`$PKG_CONFIG --cflags-only-I glesv2 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'` QMAKE_LIBDIR_OPENGL_ES2=`$PKG_CONFIG --libs-only-L glesv2 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'` @@ -4786,7 +4786,7 @@ elif [ "$CFG_OPENGL" = "es2" ]; then QMakeVar set QMAKE_LIBS_OPENGL_ES2 "`shellArgumentListToQMakeList "$QMAKE_LIBS_OPENGL_ES2"`" fi - compileTest unix/opengles2 "OpenGL ES 2.x" $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2 + compileTest unix/opengles2 "OpenGL ES 2.0" $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2 if [ $? != "0" ]; then echo "The OpenGL ES 2.0 functionality test failed!" echo " You might need to modify the include and library search paths by editing" @@ -4806,6 +4806,21 @@ elif [ "$CFG_OPENGL" = "desktop" ]; then fi fi +# If OpenGL ES 2.0 is enabled, check for 3.0 and higher. This is used to allow +# compile-time differentiation and including the version specific (but backwards +# compatible) ES headers (for example, GLES3/gl31.h). Other than that, there is +# no difference in the configuration, even the library is the same. +if [ "$CFG_OPENGL" = "es2" ]; then + if compileTest unix/opengles3 "OpenGL ES 3.0" $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2; then + # Add a define for ES3, in addition to ES and ES2. + QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_3" + fi + if compileTest unix/opengles31 "OpenGL ES 3.1" $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2; then + # Add a define for ES31. + QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_3_1" + fi +fi + # auto-detect FontConfig support if [ "$CFG_FONTCONFIG" != "no" ]; then if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists fontconfig --exists freetype2 2>/dev/null; then @@ -6494,7 +6509,7 @@ report_support " OpenSSL .............." "$CFG_OPENSSL" yes "loading librarie report_support " NIS ...................." "$CFG_NIS" report_support " OpenGL / OpenVG:" report_support " EGL .................." "$CFG_EGL" -report_support " OpenGL ..............." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.x" +report_support " OpenGL ..............." "$CFG_OPENGL" yes "Desktop OpenGL" es2 "OpenGL ES 2.0+" report_support " OpenVG ..............." "$CFG_OPENVG-$CFG_OPENVG_SHIVA" yes-yes "ShivaVG" yes-no "native" report_support " PCRE ..................." "$CFG_PCRE" yes "system library" qt "bundled copy" if [ -n "$PKG_CONFIG" ]; then -- cgit v1.2.3