Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QOpenGLExtensions



  • Hey guys,

    I'm using QOpenGLWidget for graphics rendering and I see that an extension supported by my GPU is not picked up by QT. The contextinfo example detects the right GPU and other specs but not this extension.

    I've added #include <QOpenGLExtensions> to load all extensions. My GPU driver is up to date.

    Is there a way to find out why this is happening and how to get around it?

    Cheers!


  • Lifetime Qt Champion

    Nothing wrong with that, that's what QOpenGLExtensions does by including qopengl.h.



  • @rtavakko
    For starters... What extension? What GPU? What OS + Driver? What Qt version?

    And what on earth does "not picked up by QT," actually mean? Are you getting an error message of some sort? If so, is it a runtime message or one that happens at build time? And why on earth are you keeping the message secret?

    You mention that you included that header, but what code did you use to "load all extensions?" Please take a moment to clarify what exactly you are doing, what you were expecting, and what went wrong.



  • @wrosecrans Thanks for replying.

    As I mentioned initially the contextinfo example in QT lists supported extensions when it creates a context using context() -> extensions(). There is no error message, the extension is not listed when the context is created.

    Extension: WGL_NV_DX_interop
    GPU: GeForce GTX 950M
    OS + Driver: Windows 10, driver NVIDIA 4.5.0 385.54
    Qt version: 5.12.0 MINGW (64 bit)

    I specify the context surface format in my main method:

    //Create the global OpenGL surface / context
    QSurfaceFormat format;
    format.setDepthBufferSize(32);
    format.setStencilBufferSize(8);
    
    format.setRedBufferSize(8);
    format.setGreenBufferSize(8);
    format.setBlueBufferSize(8);
    format.setAlphaBufferSize(8);
    
    format.setSwapInterval(0);  //Turn Vsync off
    
    format.setVersion(glSupportedMajorVersion,glSupportedMinorversion);
    
    format.setProfile(QSurfaceFormat::CompatibilityProfile);
    
    QSurfaceFormat::setDefaultFormat(format);
    
    //Make sure the global context is shared between threads
    QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
    

    My question is pretty straightforward. What are the steps to troubleshoot why a context does not list an extension supported by the GPU.



  • Hey guys,

    Anyone with actual knowledge on the topic have any thoughts on this? It'd be much appreciated.


  • Lifetime Qt Champion

    Hi,

    Based on the content of the QOpenGLExtensions header, yours is not there.



  • @SGaist Thanks for replying! Yes, that's true. Is there a way to add additional extensions? I'm guessing I can probably mix QT's GL with an external GL library but that doesn't sound like very rainbow-like...

    In my installation I have a wglext.h header that includes the extension:

    QtDir\Tools\mingw730_64\x86_64-w64-mingw32\include\GL


  • Lifetime Qt Champion

    Nothing wrong with that, that's what QOpenGLExtensions does by including qopengl.h.



  • @SGaist Alright, I'll give that a try. Thanks very much!