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

Impossible to share resources between QOpenGL/QuickWidgets in different TLWs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.4.0 Beta
    • 5.4.0 Alpha
    • GUI: OpenGL
    • None

    Description

      There has to be a way to share resources like textures between the contexts used by QOpenGLWidget or QQuickWidget instances that belong to different top-level windows.

      Right now the TLWs' contexts share with the internal global share context of the WebEngine fame. This is of course null when WebEngine is not in use. Therefore the TLWs' contexts do not share with each other.

      Figure out a way to enable sharing between two QOpenGLWidgets that belong to different TLWs. This was possible with QGLWidget (since the user was in ocntrol of setting up sharing) and is required by desktop app that use multiple windows with OpenGL rendering in them.

      Suggestion: Introduce an application attribute to trigger global sharing. This is anyway the case when using WebEngine, so this opt-in flag just extends it to apps that do not use WebEngine. When the attribute is set, QGuiApplication creates a dummy context and stores it in QOpenGLContextPrivate (like the WebEngine init stuff would do). (when WebEngine is used, the context provided by it takes precedence)

      This would also introduce a major convenience factor compared to the QGLWidget: Apps only need to set an app attribute instead of creating extra dummy contexts and pass around "share widgets" just to f.ex. get sharing for 3 windows.

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            lagocs Laszlo Agocs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes