Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-74736

Can't create EGL OpenGL ES context under desktop linux

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.4, 5.14.0 Alpha
    • 5.12.2
    • GUI: OpenGL
    • None
    • Linux/X11
    • 7c74048e94257c5cdc367c3144dc0e26adf06a56 (qt/qtbase/5.12)

    Description

      Under desktop linux, when using "xcb_egl" connection, request for OpenGL ES context failed(It works well when using GLX).

      setenv("QT_XCB_GL_INTEGRATION", "xcb_egl", 1)

      surf_format.setRenderableType(QSurfaceFormat::OpenGLES)

      QOpenGLContext* glctx = new OpenGLContext;

      glctx->setFormat(surf_format);

      glctx->create();

      assert(glctx->isOpenGLES());

       

      The reason is in QEglConfigChooser::chooseConfig(), eglChooseConfig() is called to select compatible config, and EGL will set EGL_RENDERABLE_TYPE attribute to all supported render type(under desktop, including OpenGL and OpenGL ES). Then OpenGL is always selected despite user asking for OES context.

      The fix seems trivial, in QEGLPlatformContext::init(), just change

      m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig);

      to

      m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig, format);

      For the same reason, call QOpenGLContext::setNativeHandle() with an EGL OES context is also broken currently.

      Please fix this, thanks!

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            wdl Liang Wei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes