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

Provide a vsync source #640

Closed
Yoric opened this issue Oct 18, 2015 · 7 comments
Closed

Provide a vsync source #640

Yoric opened this issue Oct 18, 2015 · 7 comments

Comments

@Yoric
Copy link

Yoric commented Oct 18, 2015

Servo has an issue by which it attempts to repaint (and animate, etc.) 1500 times per second. For the moment, Glutin can behave as a vsync throttler by blocking until vsync, but discussing with Gecko gfx engineers, we concluded that the best way to solve this is to provide a vsync source, and use it to trigger repaints at a reasonable framerate, as was recently added in Gecko.

I suspect that the best way to add this vsync source would be Glutin itself.

Cc @pcwalton, @nical.

@tomaka
Copy link
Contributor

tomaka commented Oct 18, 2015

What does that mean in practice? As far as I know only swapping buffers with OpenGL blocks until a vsync.

@Yoric
Copy link
Author

Yoric commented Oct 18, 2015

This means sending a signal when the hardware sends a hardware vsync signal.

@tomaka
Copy link
Contributor

tomaka commented Oct 18, 2015

I guess by "signal" you mean an event.

I can't find anything related to that on the web. All I can find is how to specify the swap interval, which changes the behavior of SwapBuffers.

@Yoric
Copy link
Author

Yoric commented Oct 18, 2015

In the document I quoted above, I see that the hardware event can be watched using CVDisplayLinkRef on MacOS X, DwmGetCompositionTimingInfo on Windows, HwcComposer2D on Android. I don't see anything about other platforms.

@Yoric
Copy link
Author

Yoric commented Oct 21, 2015

What's your judgement, @tomaka? Should this be part of Glutin, or an independent crate/lib?

@tomaka
Copy link
Contributor

tomaka commented Oct 21, 2015

Looking at DwmGetCompositionTimingInfo, in my opinion a function to query the refresh rate of the window should be part of glutin but the system that sends events is out of scope of glutin.

@kchibisov
Copy link
Member

See rust-windowing/winit#2412.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants