Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt5 frame rate a lot slower than Qt4 in D3D app? v-sync to blame?
Forum Updated to NodeBB v4.3 + New Features

Qt5 frame rate a lot slower than Qt4 in D3D app? v-sync to blame?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 1.4k Views 2 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.
  • cgripC Offline
    cgripC Offline
    cgrip
    wrote on last edited by cgrip
    #1

    Hi,

    We're developing an Windows7/8/10 application that's designed for rendering a 3D scene (kind of like a 3D modeling package ).

    We've embedded our in-house build 3D renderer into the Qt application and use it to draw on a QWidget. The renderer is build on DirectX11. We use a QTimer to signal from the QtApplication to our callback every 0ms and render our 3D scene.

    Our app was running fine in Qt4.8. The frame rate was smooth and clamped to 60fps. The 60fps clamp was because we were v-syncing our D3D draws.

    I just switched our app to use Qt5.6.

    Now, our frame rate is stuttering/choppy. I have no idea why this is. I Googled around and saw some old forum posts of people complaining about something similar (with mouse dragging behaving differently in Qt5), but they were using Qt's own OpenGL surfaces.

    http://lists.qt-project.org/pipermail/development/2014-December/019401.html
    

    Has anybody else seen similar behaviour in their applications? Is there any way to get around this problem?

    Is Qt5 now doing any v-sync stuff behind the scenes that might be causing a double v-sync (one from us and one from Qt5)?

    Thank you in advance for any help you can provide!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I'd recommend bringing this question to the interest mailing list. You'll find there Qr's developers/maintainers. This forum is more user oriented.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • cgripC Offline
        cgripC Offline
        cgrip
        wrote on last edited by
        #3

        Ah! I see.

        Thank you for letting me know!

        Cheers!

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by SGaist
          #4

          You're welcome !

          Don't forget to update this thread when you can go further with your application :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • cgripC Offline
            cgripC Offline
            cgrip
            wrote on last edited by cgrip
            #5

            We found the source of the problem.

            It turns out the jerkiness was caused by us calling QCursor::setPos() inside a mouse-drag event.

            The reason why we were doing this was that (when the user clicks and drags the mouse on the 3D view) we force the mouse position to stay in place during the drag.

            QCursor::setPos() signals out, when called.

            For some reason this wasn't a problem in Qt4, but maybe something in how the events are handled in Qt5 has changed (?)

            Anyhoot! We fixed the problem by removing the call to QCursor::setPos(). Now the frame rate is fine.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Glad you found out and thanks for sharing !

              Which overload of setPos where you using ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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