Run main rendering loop in a parallel thread

43 views
Skip to first unread message

andreykod

unread,
Nov 12, 2022, 9:01:33 AM11/12/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
Hello,

One of the additional components of my application is a qt application that uses QGraphicsScene for rendering. As stated in the documentation, the Qt GUI classes should be in the main thread and use the event loop of the main thread. QGraphicsScene renders a huge number of objects and is updated asynchronously, but rendering in the main thread leads to a significant drop in performance. So changing the size of the Qt window leads to an increase rendering time of the VSG frame by 500 times. In my application the Qt application is auxiliary and should not affect the performance of the main VSG rendering loop. The only solution to this problem I see is the launch of the main VSG rendering loop in another thread.

Are there any ways to start the main rendering loop in another thread? Is it possible? Are there platform restrictions on creating and handling VSG windows in other threads?

Regards,
Andreii

Robert Osfield

unread,
Nov 12, 2022, 11:59:36 AM11/12/22
to vsg-users : VulkanSceneGraph Developer Discussion Group
HI Andreii,

The VSG/Vulkan is multi-threaded and won't care which thread you run the main loop from.  It's Windowing toolkit that add extra constraints which you have to workaround as you have found.

So just create a thread and run the VSG's main loop from that and see what happens.   I'm not a Qt expert so can't comment on the best way to manage the Qt side.

Cheers,
Robert.
Reply all
Reply to author
Forward
0 new messages