XMLWordPrintable

    Details

    • Platform/s:
      All

      Description

      Qt Gui can not depend on OpenGL in Qt 6 anymore. Move all the OpenGL related classes into the Qt OpenGL module. (or somewhere else if that's removed/deprecated)

      To be done in line with QRhi's needs: this must not include things like QOpenGLContext, QOpenGL(Extra)Functions, and QOpenGLProgramBinaryCache, and all OpenGL-related QPA plumbing. Those are also dependencies for the RHI's OpenGL backend.

      This is currently being done in smaller chunks:

      done in reviews/waiting for coin

      QOpenGLDebugLogger
      QOpenGLTimerQuery
      QOpenGLWindow
      QOpenGLPaintEngine and related classes
      QOpenGLTexture and related classes
      QOpenGLTextureBlitter - Was used by QPlatformBackingStore, decoupled in this patch and moved in this one
      QOpenGLFrameBufferObject
      QOpenGLWidget has been moved to a new QtOpenGLWidgets module (similarly to QtQuickWidgets).
      QOpenGLShaderProgram - Can be moved after QOpenGLTextureBlitter
      QOpenGLVertexArrayObject - Can be moved after texture blitter
      QOpenGLBuffer - Can be moved after texture blitter
      QOpenGLVersionFunctions*: We're changing the API (source incompatible) slightly and moving these.

      This leaves us with:

      • qopengles2ext.h
      • qopenglextensions_p.h
      • qopenglext.h
      • qopenglextrafunctions.h
      • qopenglfunctions.h
      • qopengl.h
      • QOpenGLContext - Used by RHI, if we wan't to remove it from public gui API, we need to make it private and provide a wrapper in the opengl module. WIP patch: https://codereview.qt-project.org/c/qt/qtbase/+/292370
      • QOpenGLFunctions and QOpenGLExtraFunctions (non versioned) - These are used by RHI (same as QOpenGLContext)

      I modeled the dependencies as I came across them:

      The image is showing work of patches that I considered done (yellow boxes haven't passed reviews/CI yet).

      Status 23/03

      • Then, the next step would be doing something with the Khronos extension headers (qopenglext.h qopengles2ext.h). These are included from qopengl.h which makes things tricky. Perhaps doable with some sort of jugglery with splitting qopengl.h into two (one in gui, not including the ext headers, another one on opengl that does; or something along those lines).
      • After that my proposal would be to stop there. QOpenGLContext (and its backing QPlatformOpenGLContext), and the (cross-platform) function resolvers (qopenglfunctions.h etc.) should stay in Gui as they are required by the RHI anyways. Moving these would also open up the same problem for any other API - e.g., why should QVulkanInstance be in Gui then? Moving these is not reasonable (or valuable) in my mind.

        Attachments

        1. qtopenglclasses.dia
          7 kB
        2. qtopenglclasses.png
          qtopenglclasses.png
          228 kB
        3. qtopenglclasses.png
          qtopenglclasses.png
          225 kB
        4. qtopenglclasses.png
          qtopenglclasses.png
          203 kB
        5. qtopenglclasses.png
          qtopenglclasses.png
          119 kB

          Issue Links

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

            Activity

              People

              Assignee:
              esabraha Eskil Abrahamsen Blomfeldt
              Reporter:
              laknoll Lars Knoll
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are 2 open Gerrit changes