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

QEGLPbuffer reports itself as invalid on platforms with surfaceless contexts

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.9.3
    • Fix Version/s: 5.9.4
    • Component/s: GUI: OpenGL
    • Labels:
      None
    • Environment:
      Ubuntu 17.10 (build host)

      Google Pixel running Android 8.0 (target environment)

      Android NDK 16

       

       
    • Commits:
      6a5ca7240a03cce4e490b493bb6185df019e7d87

      Description

      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;`

       

       

        Attachments

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

          Activity

            People

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            jherico Bradley Austin Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes