mirror of
https://github.com/xemu-project/xemu.git
synced 2026-10-19 17:19:19 +02:00
In #2691, xemu was updated to decouple the guest vblank interrupt from the host refresh. This allows the UI thread to run at host FPS while the guest runs at 60 fps, matching HW behavior. On Window machines using AMD drivers, this led to a major decrease in guest performance when vsync is enabled, apparently due to locking behavior in the driver holding the guest pfifo thread while awaiting vblank. This manifests as reduced perf that gets worse when running at a lower display refresh rate. This PR bypasses the GL swap entirely, utilizing Windows DXGI to perform swaps and allowing the pfifo operations to proceed without blocking. https://github.com/abaire/xemu-perf-tests/blob/4115d262c5e80d6b71234f8df65fa78c8ef15e12/src/tests/surface_rendering_tests.cpp#L167 reproduces the issue seen with Conker L&R (slow glo_readpixels) but it is somewhat subtle at the given tuning. Modifying this test to perform more draws per frame will likely produce a more obvious result w/ the pre-PR builds as there are more opportunities for glReadPixels to stall on main thread vblank waits.