[Interest] OpenGL ES 3.1 and Tessellation

Agocs Laszlo laszlo.agocs at theqtcompany.com
Sun May 17 19:47:26 CEST 2015


Hi,

When targeting Android, setVersion(3,1) is enough (and may not even be required with most drivers since they will give you the highest ES version anyhow). Setting the renderable type is not necessary since the default on that platform is ES. Setting the profile is wrong, that concept does not exist in ES.

You can then simply include <GLES3/gl31.h> and use the functions directly. (this should work, the conflicts you mentioned are not expected) For extensions, use http://doc.qt.io/qt-5/qopenglcontext.html#getProcAddress and extension() / hasExtension(). qopengles2ext.h provides the constants and function pointer typedefs for pretty much all extensions, but you have to do the function resolving manually.

If you are after something more cross-platform, for example developing your app with GLES 3.1 features on a desktop platform using OpenGL 3/4, then it becomes trickier. QOpenGLFunctions (the non-versioned one) provides a cross-platform, cross-GL-GLES wrapper for all of GLES 2.0, but it does not contain any ES 3.x functions at the moment. Therefore the way to go for now is to use QOpenGLFunctions for ES 2.0 functions and call the ES 3.x specific ones directly (when running on an OpenGL ES platform) or via the versioned QOpenGLFunctions_N_M wrappers (when on OpenGL).

The versioned wrappers are fairly useless when it comes to ES: QOpenGLFunctions_ES2 has no proper cross-GL-GLES compatibility and is available only in -opengl es2 builds, i.e. when the functions are callable directly anyhow. Adding an ES3 or ES31 variant would not really solve the problems here.

Extending QOpenGLFunctions with ES 3.0/3.1 is on the table, but no concrete plans are available yet. Maybe Qt 5.6, maybe 5.7.

Best regards,
Laszlo


From: Daniel Watkins <dwatkins at valpineware.com<mailto:dwatkins at valpineware.com>>
Date: Sunday 17 May 2015 06:04
To: "interest at qt-project.org<mailto:interest at qt-project.org>" <interest at qt-project.org<mailto:interest at qt-project.org>>
Subject: [Interest] OpenGL ES 3.1 and Tessellation

Hey guys,

I've been scavenging the internet for a few weeks here trying to figure out how to access OpenGL ES 3.1 through Qt. According to the new features list for the 5.4 and 5.5 releases, there is talk about ES 3, but there doesn't appear to be much documentation about how to use it. It seems that to get an ES 3.1 context for a QQuickView, you can do the following:


QSurfaceFormat format = view.format();

format.setProfile(QSurfaceFormat::CoreProfile);

format.setRenderableType(QSurfaceFormat ::OpenGLES);

format.setVersion(3, 1);

view.setFormat(format);


But is there a way to actually access the ES31 functions? There clearly is not a QOpenGLFunctions_ES31 class. I tried straight up including the Khronos header file, but that ended up with some conflicts. Rummaging around in the qtbase/src/gui/opengl directory, there appears to be a private QOpenGLES3Helper class, and talk about the Android extensions pack, which leads to my next concern.


How might someone go about accessing the tessellation shader extensions available on certain Android devices? I'm seeing this #define GL_ANDROID_extension_pack_es31a in qopengles2ext.h, so it appears likely possible.


Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150517/9c2613a8/attachment.html>


More information about the Interest mailing list