[RadeonSI] X-Plane 12: Vulkan - OpenGL bridging causes plugin flickering
This basically a continuation of #3895 (closed) for X-Plane 12.
Description:
X-Plane 12, at the time of issuing this report in its public beta phase, still has severe issues with drawing third party, OpenGL based plugins. While the ddrawing of plugins in 3D cockpit spaces now takes place, there is zero synchronization between the (exclusively) OpenGL-drawn plugins and the (exclusively) Vulkan-drawn rendering engine. The result is flickering of any OpenGL-drawn scene element, 2D window or 3D cockpit display. See this video:
This is worse than in X-Plane 11, where at least 2D drawn plugins would display just fine.
System information:
- AMD Radeon 6900XT on a AMD Ryzen 5800X, with Gigabyte X570UD, 32 GB 3600 MHz RAM
- Arch Linux, kernel 5.19.12
- Mesa 22.1 to 22.3 (independent of version)
- KDE Plasma 5.25.5
- X-Server 21.1.4 (also happens with Wayland 1.21.0 with xwayland 22.1.3)
Reproduction
- Download the X-Plane 12 demo (fully functional, only has a 15 or 20 minute session time limit)
- Download a third-party plugin, e.g. DataRefTool or https://github.com/fpw/avitab (install into X-Plane 12/Resources/plugins) for flickering 2D windows.
- When the Avitab plugin is installed, you can experience the issue on displays drawn in 3D space by installing the open source PZL M-18. Alternatively, you can also try the open source A321 (not the one from the example video above), which does not use Avitab, but offers more displays that flicker.
Install either >(or both of) these aircraft into "X-Plane 12/Aircraft". - Start X-Plane. All aircraft can be quickstarted from the "Flight" --> "Start aircraft to running" menu.
- Any custom drawn 2D windows or displays in the 3D cockpit should flicker heavily.
Workarounds
- The flickering decreases or even stops when simulator framerate is at or near a limiter as imposed by Vsync (60 FPS) or by launching X-Plane with its internal framerate limiter (
--lock_fr=45
swtartup parameter), so I figure this is a timing issue.
Notes
Since the issue seems to be one of timing between Vulkan and OpenGL contexts to me, is it possible to force the OpenGL context in line with the Vulkan one by means of refreshing OpenGL every n-th frame? Maybe by means of Mesa environment variable for particular applications?
@justsid, one of the main rendering engine developers at Laminar Research, is aware of the flickering issue as stated on the X-Plane forums, but the planned Zink implementation that should remedy the situation is still in development without any ETA. So having a global fallback option would be nice.
The natural course of action would be to only have plugins drawing via Vulkan in X-Plane, but this still appears to be a few years away.