Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. Qt5: can WebGL work with ANGLE on Windows via QtWebEngine?

Qt5: can WebGL work with ANGLE on Windows via QtWebEngine?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
qtwebenginewebglwindowsangle
8 Posts 4 Posters 8.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    drmatt
    wrote on 19 Aug 2017, 17:45 last edited by
    #1

    We are still struggling with viewing some WebGL pages on Windows using Intel graphics hardware. We've tried many combinations of build-time configure flags and runtime settings in 5.9.1 and 5.10.0 releases, but none of them work completely for our particular use case.

    We had to patch web_engine_context.cpp in a custom Qt build and pass the -ignore-gpu-blacklist flag to our application for WebGL to work at all (post). And even then, some content does not appear correctly - there are many examples in which geometry appears completely black / unlit (post).

    Our understanding is that ANGLE is meant to normalize OpenGL operation across most Windows hardware by translating to Direct3D calls, thus removing the dependency on system-specific and GPU-specific OpenGL libraries. Chrome browser uses ANGLE by default, and it works fine with all WebGL content on all hardware we've tried. So we expected that we could make QtWebEngine work more consistently and correctly if we forced Qt to use ANGLE rather than Desktop GL.

    But when we try to use ANGLE via the Qt::AA_UseOpenGLES setting, WebGL does not work at all, no matter what hardware we're running on. The chrome://gpu settings page reports that in this case, QtWebEngine is actually passing -disable-gpu and is not using an ANGLE renderer. However it does appear that the proper dlls are being loaded and that GLES is actually being initialized at program startup.

    In Chrome browser, for instance, we see this line in chrome://gpu:

    GL_RENDERER: ANGLE (NVIDIA Quadro M2000M Direct3D11 vs_5_0 ps_5_0)
    

    But via QtWebEngine, GL_RENDERER is blank, all hardware acceleration is disabled, and all WebGL is disabled.

    Looking at the logic in web_engine_context.cpp, it seems that if ANGLE is enabled, then the glType variable is not set; and if glType is not set, then the kDisableGPU switch is enabled. Is this intended behavior, or a known bug?

    This has been a very frustrating issue. What are we missing? Should we expect WebGL to work at all with ANGLE? What is the preferred reliable way to get WebGL content to work on Windows, particularly on Intel GPUs?

    J 1 Reply Last reply 24 Aug 2017, 15:13
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 19 Aug 2017, 18:53 last edited by
      #2

      @drmatt said in Qt5: can WebGL work with ANGLE on Windows via QtWebEngine?:

      chrome://gpu

      Hmm, it reports NVIDIA Quadro M2000M , so i wonder if this on a optimus laptop ?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        drmatt
        wrote on 19 Aug 2017, 19:04 last edited by
        #3

        Yes, you're right - it's an optimus laptop. Is this a factor because of the Intel GPU? And if so, is it known that ANGLE + WebGL does not work on this hardware?

        M 1 Reply Last reply 20 Aug 2017, 07:58
        0
        • D drmatt
          19 Aug 2017, 19:04

          Yes, you're right - it's an optimus laptop. Is this a factor because of the Intel GPU? And if so, is it known that ANGLE + WebGL does not work on this hardware?

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 20 Aug 2017, 07:58 last edited by mrjj
          #4

          @drmatt
          Hi
          Well, i cant tell if directly related to you issue but i have had many issue with those
          optimus solutions .
          Also as you can see , it works on chrome as it uses the nvidia and not the intel.

          I think you intel HD is new enough for webGL to work
          https://www.khronos.org/webgl/wiki/BlacklistsAndWhitelists
          but it might have issue anyway.

          I would ask on the
          http://lists.qt-project.org/mailman/listinfo
          since we are user here.

          Since you had to remove it from ignore-gpu-blacklist, it might be a lost cause to make it work but then
          you at least know for sure.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            drmatt
            wrote on 20 Aug 2017, 20:19 last edited by
            #5

            Thank you for the response and suggestions. It may indeed be the case that desktop-based OpenGL is a lost cause for some Intel HD graphics hardware (at least the generations that we're using). We found that even in the latest Chrome browser, on the Surface Pro 3 (which uses Intel hardware exclusively), if we pass --use-gl=desktop, we see the same black geometry issues as we see in QtWebEngine.

            However, this is why we thought that ANGLE exists. When running Chrome with ANGLE, which is the default, WebGL works fine on all hardware we've tested. So we thought that QtWebEngine + ANGLE should also work fine. But we can't get WebGL to work at all with the Qt::AA_UseOpenGLES setting, and we're not sure if this is expected behavior or if we're doing something wrong.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              drmatt
              wrote on 21 Aug 2017, 20:31 last edited by
              #6

              Update: response from the developer mailing list is that WebGL cannot work with ANGLE.

              ANGLE does not support multi-threaded access to GL contexts, and that is a requirement for the current Qt Quick Scene Graph implementation used by WebEngine.

              So unfortunately we are stuck with using desktop GL, whose performance is subject to the quality of the GPU drivers (which in our case are deficient).

              1 Reply Last reply
              0
              • D drmatt
                19 Aug 2017, 17:45

                We are still struggling with viewing some WebGL pages on Windows using Intel graphics hardware. We've tried many combinations of build-time configure flags and runtime settings in 5.9.1 and 5.10.0 releases, but none of them work completely for our particular use case.

                We had to patch web_engine_context.cpp in a custom Qt build and pass the -ignore-gpu-blacklist flag to our application for WebGL to work at all (post). And even then, some content does not appear correctly - there are many examples in which geometry appears completely black / unlit (post).

                Our understanding is that ANGLE is meant to normalize OpenGL operation across most Windows hardware by translating to Direct3D calls, thus removing the dependency on system-specific and GPU-specific OpenGL libraries. Chrome browser uses ANGLE by default, and it works fine with all WebGL content on all hardware we've tried. So we expected that we could make QtWebEngine work more consistently and correctly if we forced Qt to use ANGLE rather than Desktop GL.

                But when we try to use ANGLE via the Qt::AA_UseOpenGLES setting, WebGL does not work at all, no matter what hardware we're running on. The chrome://gpu settings page reports that in this case, QtWebEngine is actually passing -disable-gpu and is not using an ANGLE renderer. However it does appear that the proper dlls are being loaded and that GLES is actually being initialized at program startup.

                In Chrome browser, for instance, we see this line in chrome://gpu:

                GL_RENDERER: ANGLE (NVIDIA Quadro M2000M Direct3D11 vs_5_0 ps_5_0)
                

                But via QtWebEngine, GL_RENDERER is blank, all hardware acceleration is disabled, and all WebGL is disabled.

                Looking at the logic in web_engine_context.cpp, it seems that if ANGLE is enabled, then the glType variable is not set; and if glType is not set, then the kDisableGPU switch is enabled. Is this intended behavior, or a known bug?

                This has been a very frustrating issue. What are we missing? Should we expect WebGL to work at all with ANGLE? What is the preferred reliable way to get WebGL content to work on Windows, particularly on Intel GPUs?

                J Offline
                J Offline
                JonMerel
                wrote on 24 Aug 2017, 15:13 last edited by
                #7

                On Windows there seems to be at least 6 options for Chromium rendering:

                1. QT_OPENGL=desktop (using Windows drivers)
                2. QT_OPENGL=desktop (using MESA)
                3. QT_OPENGL=angle && QT_ANGLE_PLATFORM = d3d11 / d3d9
                4. QT_OPENGL=angle && QT_ANGLE_PLATFORM = warp
                5. QT_OPENGL=software (different from option 2?)
                6. QMLSCENE_DEVICE=softwarecontext

                Have you tried the option #6?
                I don't know if WebGL work in this context.

                1 Reply Last reply
                0
                • Z Offline
                  Z Offline
                  zura
                  wrote on 21 Feb 2018, 21:45 last edited by
                  #8

                  Nowadays the software renderer for WebGL works fine. I wonder if there is some easy way to detect if the video adapter is affected (probably intel && being "old") and if that's the case, to switch to software renderer, at run-time - maybe before initializing QApplication? in order to pass --enable-webgl-software-rendering parameter programmatically.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved