Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt Threaded Renderer
Forum Updated to NodeBB v4.3 + New Features

Qt Threaded Renderer

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 3.7k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    Raynor
    wrote on last edited by
    #1

    Hi

    I have a 3D engine that run entierely in one thread. I can't separate inputs from renderer.
    I subclassed QQuickItem so my entiere engine can render with QML's OpenGL context.
    Everything works fine on Windows because there is no threaded renderer.
    But there is on MacOSX. So it crashes everytime QML wants to call my engine because my engine run entierely on the renderer thread.

    Is there a way to deactivate threaded renderer?
    If not, what is the Qt solution to be interoperable with non threaded opengl engines?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on last edited by
      #2

      You can set the environment variable
      QML_BAD_GUI_RENDER_LOOP=1 on mac to force the non threaded renderer.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Raynor
        wrote on last edited by
        #3

        It works great, thx. Even on Android.
        Is it a fix officialy supported by Qt and will it continue to be in the future?

        1 Reply Last reply
        0
        • slettaS Offline
          slettaS Offline
          sletta
          wrote on last edited by
          #4

          The right way to integrate with the scene graph when you cannot run on the rendering thread is to render to an FBO using a QOpenGLContext which has context sharing with the scene graph's opengl context. The resulting FBO can then be rendered as a texture in the scene graph.

          The examples/quick/scenegraph/textureinthread example illustrates how this can be done.

          As the name "QML_BAD_GUI_RENDER_LOOP" is not all that friendly, the environment variable is "QSG_RENDER_LOOP=basic" or "QSG_RENDER_LOOP=windows" starting with 5.1. Both "basic" and "windows" are doing rendering on the GUI thread. This flag is meant to be used as a debugging measure mostly, it is not properly supported API, but chances that it will go away is very small :)

          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