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

Impossible to disable vsync glcore #1177

Closed
roig opened this issue Jan 5, 2025 · 2 comments
Closed

Impossible to disable vsync glcore #1177

roig opened this issue Jan 5, 2025 · 2 comments

Comments

@roig
Copy link

roig commented Jan 5, 2025

Hello, I found that is impossible to disable vsync (at least when using GLCORE):

In sapp_desc I put swap_interval to 0 but this line is defaulting it to 1:
res.swap_interval = _sapp_def(res.swap_interval, 1);

Maybe I'm not understanding swap_interval correctly.
But I think _sapp.wgl.SwapIntervalEXT(0); disables vsync so the _sapp_def to 1 when is 0 seems wrong.

@floooh
Copy link
Owner

floooh commented Jan 6, 2025

Yes, disabling vsync altogether isn't supported by sokol_app.h, but not for the '0 vs 1' situation you stumbled over.

Implementing this across all backends would be a non-trivial job (e.g. AFAIK it's completely impossible on web with requestAnimationFrame, and on macOS/iOS with MTKView it's also only possible by not using the 'canonical' way to drive the frame loop).

The current swap_interval thing also isn't very useful in practice and will eventually be replaced by something like a target-frame-rate, but this still will be vsync-throttled.

@floooh
Copy link
Owner

floooh commented Jan 6, 2025

I'll close this as duplicate of #1053 and #292

@floooh floooh closed this as not planned Won't fix, can't repro, duplicate, stale Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants