Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event processing in SDL - improvement ideas #17876

Open
hrydgard opened this issue Aug 9, 2023 · 0 comments
Open

Event processing in SDL - improvement ideas #17876

hrydgard opened this issue Aug 9, 2023 · 0 comments
Labels
OpenGL SDL2 Issue on SDL (or Qt in SDL code) but not all ports. Vulkan
Milestone

Comments

@hrydgard
Copy link
Owner

hrydgard commented Aug 9, 2023

Currently in SDL we do event polling in bursts each frame on the emulator main thread, which means that events will arrive in bursts at each "frame border" rather than asynchronously during gameplay. This likely is another cause of input lag, especially in 30hz games. #17685

Instead of polling for events every frame, we should just sit in a tight WaitEvent-loop, and have emulation and rendering happening on a different thread. This would be perfectly possible to implement with Vulkan and would be very similar to what we're doing on Windows.

However OpenGL comes with the complication that presentation has to happen on the same thread that created the context.

There does however seem to be workarounds that work:

https://skryabiin.wordpress.com/2015/04/25/hello-world/

But might simply not bother with improving lag with OpenGL for now.

@hrydgard hrydgard added the SDL2 Issue on SDL (or Qt in SDL code) but not all ports. label Aug 9, 2023
@hrydgard hrydgard added this to the v1.17.0 milestone Aug 9, 2023
@hrydgard hrydgard modified the milestones: v1.17.0, Future-Prio Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OpenGL SDL2 Issue on SDL (or Qt in SDL code) but not all ports. Vulkan
Projects
None yet
Development

No branches or pull requests

1 participant