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

QtWebEngine forces use of high-power GPU when core profile is requested

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • 5.10.0, 5.12.3
    • WebEngine
    • None
    • macOS
    • macOS

      I have this code to force use of OpenGL 4.1 (rather than 2.1, as would be used by default):

       

      QSurfaceFormat format = QSurfaceFormat::defaultFormat();
      format.setMajorVersion(3);
      format.setMinorVersion(2);
      format.setProfile(QSurfaceFormat::CoreProfile);
      QSurfaceFormat::setDefaultFormat(format);

       

      This forces use of the Core profile, which seems to be necessary for GL contexts to use versions later than 2.x on macOS (correct me if I'm wrong).

      Chromium gates use of dynamic GPU switching behind a check for the "-use-gl" switch's value matching "desktop". web_engine_context.cpp sets that value to "core" when the default format's profile is core. This results in dynamic GPU switching being disabled, which in practice forces use of the high-power GPU.

      I'm not sure if this should be solved by adjusting Chromium's check, or dropping the "core" switch in WebEngine. On my system, sending "desktop" on the "-use-gl" switch works fine, but I'm not sure if this would have negative implications in other cases.

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

            qt_webengine_team Qt WebEngine Team
            rcombs Ridley Combs
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes