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. QWindow OpenGL Tearing
QtWS25 Last Chance

QWindow OpenGL Tearing

Scheduled Pinned Locked Moved Unsolved General and Desktop
qwindowopenglvsyncglitchqsurfaceformat
5 Posts 2 Posters 993 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.
  • R Offline
    R Offline
    rtavakko
    wrote on last edited by
    #1

    I'm having a strange issue with a setup that uses a class inheriting QOffscreenSurface and one inheriting QWindow (QT 5.14.2 MSVC 2017 64 bit, Windows 10). The offscreen renderer creates an OpenGL texture and the window displays it.

    I see what seems to be a VSync-related tearing on the output window:
    normal.jpg glitch.jpg

    There is no pattern it seems to be on different parts of the screen and not at any specific times. It happens more often when the output resolution is higher. Turning VSync off using QSurfaceFormat::setSwapInterval(0) seems to be a work around which would mean that somehow something during the rendering process is interfering with the screen buffer swap.

    The code to reproduce this is here:
    https://github.com/rtavakko/Tearing

    Has anyone seen this happen and know what could be causing the problem? Any tips would be greatly appreciated.

    Cheers

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

      Hi,

      Your code is pretty big to go through.
      Would it be possible to reduce it ?

      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
      • R Offline
        R Offline
        rtavakko
        wrote on last edited by rtavakko
        #3

        @SGaist Sure, I've removed some of the unused files and code. Let me know if I can simplify it more.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rtavakko
          wrote on last edited by
          #4

          An update on this, it seems to happen only when there are two or more windows active which would again point to a sync-related issue? I'm also not sure if having multiple OpenGL contexts all sharing resources could be contributing. Theory says this should be ok.

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

            It should be supported indeed. Did you try with a more recent release of Qt ? Like 5.15 or even 6.2 ?

            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