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

QQuickWindow defaults to creating an OpenGL context with uneeded expensive fallback compatibility

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P2: Important P2: Important
    • None
    • 5.3.1
    • None

      Whilst profiling an application we found a lot of memory (15Mb per screen) was used in the intel graphics driver on startup

      The 15Mb per screen is used in _swrast_CreateContext which from the documentation of the calling code is

      /* Initialize the software rasterizer and helper modules.
      *

      • As of GL 3.1 core, the gen4+ driver doesn't need the swrast context for
      • software fallbacks (which we have to support on legacy GL to do weird
      • glDrawPixels(), glBitmap(), and other functions).
        */
        if (api != API_OPENGL_CORE && api != API_OPENGLES2) { _swrast_CreateContext(ctx); }

      i.e it's only for fallback old code, and it has a considerable overhead. From working bacwards we only enter this code if we are requesting to use really really old openGL or some compatibility features.

      From debug in QGLXContext it turns out by default we are requesting OpenGL 2.0.

      We can do a setFormat on a per window per application basis and get an improvement, but I feel this might be better served in Qt. As I understand it QtQuick 2.0 requires much higher level OpenGL anyway, so we shouldn't be requesting such old versions by default.

      Hardcoding the requested version to OpenGL 3.2 shows a considerable saving under massif and top shows a massive difference.

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

            lagocs Laszlo Agocs
            davidedmundson David Edmundson
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes