[Development] OpenGL in Qt 5.1 and onwards

Sean Harmer sean.harmer at kdab.com
Mon Mar 4 11:12:36 CET 2013


just thought I would post a quick update on where we stand with this set 
of features:

On 18/12/2012 13:34, Sean Harmer wrote:
> Hi,
> I would like to start a discussion on the future level of support for OpenGL
> enablers in Qt for those that are interested. So here goes...
> I would like to add in a bunch more OpenGL enablers but am not sure on where
> to best put them. Some things I have in mind are:
> 1) Classes that contain member functions for all OpenGL functions of a given
> version and profile. E.g. no need to use GLEW or similar. WIP version of this
> at
This is now in. You can obtain a pointer to an object containing a 
member function for every version of the requested OpenGL version by 
calling QOpenGLContext::versionFunctions<T>() where T is the type of 
object you wish e.g. QOpenGLFunctions_4_3_Core.

The OpenGL extension classes have been put into a new static library 
which requires QT+=openglextensions to be added to your .pro file.

With these I think Qt provides everything that GLEW, GLEE and similar 
> 2) An QOpenGLVertexArrayObject class. This would be just a thin wrapper around
> a VAO with possibly some API to make it easier to use with QOpenGLBuffer and
> QOpenGLShaderProgram.
There is now a QOpenGLVertexArrayObject class.

> 3) OpenGL occlusion and timing query objects. Again these are good candidates
> for QtGui I think but if people object they could go into Qt3D again. The
> timing query object in particular would be valuable for profiling the GPU time
> spent in rendering QtQuick 2 scenes. Iirc then right now only the CPU time is
> available in qtdeclarative but that is only half the story for profiling this
> stuff.
Timer queries and a higher-level helper are up for review at 

I hope to add occlusion queries for 5.2.
> 4) Transform feedback object. Another small but useful candidate for inclusion
> in QtGui. These objects allow you to perform calculations on the GPU and write
> the results to a bound buffer object before the rasterisation stage. This can
> be used to perform animation updates for particles or physical simulations on
> the GPU for example. The output buffer is then used in a second pass to render
> with the calculated parameters. Would be very nice to integrate with
> QOpenGLBuffer and QOpenGLShaderProgram again.
Not had enough bandwidth to work on this yet but again will hopefully 
make it in for 5.2.
> 5) Provide support for Geometry, Tessellation Control, Tessellation Evaluation
> and Compute Shader support in QOpenGLShaderProgram. I don't see anything
> contentious with these. They are just extending QOpenGLShader and/or
> QOpenGLShaderProgram.
QOpenGLShaderProgram and QOpenGLShader now support all programmable 
shader stages offered by OpenGL including compute shaders. The 
underlying requirements still apply of course so for example compute 
shaders require an OpenGL 4.3 context (which Qt also makes easy if the 
platform supports it).
> 6) Integrate support for the GL_ARB_debug_output extension into the Qt debug
> message system. Peppe has said he will start to look at this shortly and I
> think this would be an awesome feature to have available where the extension
> is supported.
My colleague and friend peppe was kind enough to take this on which has 
resulted in a very useful QOpenGLDebugLogger. See 
> 7) More enabler classes for textures, samplers, and higher-level abstractions.
> I think these would be good candidates for a Qt3D library, unless someone
> would really like to see a subset in QtGui.
These will also have to wait for 5.2.

So all things considered, Qt 5.2 is shaping up to be a nice release with 
respect to support for OpenGL.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130304/dfab7e91/attachment.html>

More information about the Development mailing list