Changes between Version 2 and Version 3 of Ticket #9640, comment 2
- Timestamp:
- Sep 5, 2023, 6:13:58 PM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #9640, comment 2
v2 v3 5 5 1) Make sure mirroring is not locking to 60Hz vsync. 6 6 7 Result: Indeed with Oculus OpenXR and mirroring chimerax "graphics rate on" shows 60 fps, while with OpenXR steamvr runtime it shows 90 fps. This explains the flicker. It turns out the ChimeraX wait_for_vsync() routine no longer works on Windows. Apparently it was broken long ago by Qt 6 which resets the wait for vsync mode on every makeCurrent according to the QSurfaceFormat.swap_interval setting. I 've put in code to set the wait_for_vsync behavior on every makeCurrent on Windows if it differs from the Qt setting and that fixes the problem. But it would probably be better to try to tell the Qt QOpenGLContext the new setting, or possibly it is associated with the QWindow for the context. Need to test if that can be done.7 Result: Indeed with Oculus OpenXR and mirroring chimerax "graphics rate on" shows 60 fps, while with OpenXR steamvr runtime it shows 90 fps. This explains the flicker. It turns out the ChimeraX wait_for_vsync() routine no longer works on Windows. Apparently it was broken long ago by Qt 6 which resets the wait for vsync mode on every makeCurrent according to the QSurfaceFormat.swap_interval setting. I fixed the wait for vsync problem by changing the code to use QSurfaceFormat.setSwapInterval() instead of wglSwapIntervalEXT(). This fixes the problem. 8 8 9 9 2) See if no swap buffers but glFinish() causes the flicker. 10 11 Flicker was caused by mirroring locking to the display refresh rate because the chimerax code that disabled wait for vsync was not working. Fixed now. 12 10 13 3) See if rendering the mirrored image to the front buffer with no swap buffers causes flicker. 14 15 Not necessary since vsync problem fixed. 16 11 17 4) See if the Quest headset used through the OpenXR steamvr runtime flickers. 12 18 13 The best hope for allowing mirror with Quest is probably to draw to the front buffer without the swap. 19 Did not flicker. Apparently the SteamVR library somehow disabled waiting for vsync, so it didn't matter that the chimerax code to disable vsync was broken. 20 21