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

QEGLPbuffer reports itself as invalid on platforms with surfaceless contexts



    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.4
    • 5.9.3
    • GUI: OpenGL
    • None
    • Ubuntu 17.10 (build host)

      Google Pixel running Android 8.0 (target environment)

      Android NDK 16


    • 6a5ca7240a03cce4e490b493bb6185df019e7d87


      I have a wrapper class `OffscreenGLCanvas` that creates a QOpenGLContext and a QOffscreenSurface for supporting offscreen rendering, multiple contexts, etc.  After creating the context and the surface I normally check the validity of the offscreen surface with `isValid`.

      However, while working on porting my application to Android I discovered that the isValid call would return false, causing an error in my application.

      Eventually I tracked this down to code inside the `QEGLPbuffer` class.  In the constructor there is an early return if the `EGL_KHR_surfaceless_context` extension is available.  The QOffscreenSurface even calls this out as a possibility.  However, it doesn't make sense to me that the `isValid` call would return false in this case.  It leaves me with no way to determine whether a given QOffscreenSurface is reporting invalidity because I can't use it or because I don't need it.  

      It seems like the logic in the QEGLPbuffer constructor should populate a member like `m_surfaceless` instead of using a local variable in the constructor, and then the `isValid` call could be changed to `return m_surfaceless || m_pbuffer != EGL_NO_SURFACE;`




        For Gerrit Dashboard: QTBUG-65125
        # Subject Branch Project Status CR V



            lagocs Laszlo Agocs
            jherico Bradley Austin Davis
            0 Vote for this issue
            1 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes