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

Wayland rendering issues regression

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/Wayland

      Description

      The map application is an IVI application that is drawn to a Wayland Compositor. The map rendering is based on the QtQuick textureinthread example, qt5/qtdeclarative/examples/quick/scenegraph/textureinthread

      The map rendering runs on its own thread.

      It has its own QOpenGLContext similar to qt5/qtdeclarative/examples/quick/scenegraph/textureinthread/threadrenderer.cpp.html#247

      It has its own QOffscreenSurface similar to qt5/qtdeclarative/examples/quick/scenegraph/textureinthread/threadrenderer.cpp.html#233

      When time to render, the map rendering calls “context->makeCurrent(surface);”that is it makes its own QOpenGLContext current in its own thread, against its own QOffscreenSurface similar to
      qt5/qtdeclarative/examples/quick/scenegraph/textureinthread/threadrenderer.cpp.html#91

      The issue is tracked down to line 410 of change list https://github.com/qt/qtwayland/commit/bf09c7a1493c01a65ee0f110b37a04e653edc08e

      Line 410 changes from “window->updateSurface(true);” to (window->updateSurface(window->isExposed());”, see below.

      if (eglSurface == EGL_NO_SURFACE) {
      - window->updateSurface(true);
      + window->updateSurface(window->isExposed());
      eglSurface = window->eglSurface();
      }
      

      The “window->isExposed()” always return false because the window is from a QOffscreenSurface:

      QWaylandEglWindow *window = static_cast<QWaylandEglWindow *>(surface);

      Since the “window->isExposed();” always returns false, the eglSurface of the window will not get created, or in another word, it always has the value of EGL_NO_SURFACE.

      With eglSurface has no surface, the call to eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context) will create a EGL_KHR_surfaceless_context, https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_surfaceless_context.txt

      if (!eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) {
      qWarning("QWaylandGLContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this);
      window->setCanResize(true);
      return false;
      }
      

      This is where the map render goes wrong. The map does get render but it is rendered incorrectly.

      This was working correctly with Qt 5.9.4.

        Attachments

        1. fbo_map_bad.bmp
          fbo_map_bad.bmp
          1.10 MB
        2. fbo_map_good.bmp
          fbo_map_good.bmp
          1.10 MB

          Issue Links

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

            Activity

              People

              • Assignee:
                johanhelsing Johan Helsing
                Reporter:
                karimpinter Karim Pinter
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes