Allow setting the swap interval value or not setting it at all instead of always forcing it to 0.
The changes of 3dde6bd (Disable swap interval in GLX wxGLCanvas implementation too, 2023-12-25) are not always desirable, so allow to customize the behaviour.
https://github.com/wxWidgets/wxWidgets/pull/25449
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I've completely forgot about this one because it was marked as "Draft" and by now I don't remember why any more.
@dsa-t I think this was requested by you, would this still be useful?
In any case, we need to either merge or close it.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I think SetSwapInterval needs to be implemented in each GL backend, not just wxGLCanvasX11::GLXSetSwapInterval.
And I don't think the interval should be changed inside SwapBuffers.
For Wayland, I think a solution similar to SDL can be implemented (see #24977 (comment))
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Also I'm not sure if wxGLSetSwapInterval checks for the extension correctly.
glXSwapIntervalEXT function may exist in the client library, but GLX_EXT_swap_control/GLX_EXT_swap_control_tear extensions may not supported by the driver.
See how it's implemented in KiCad: https://gitlab.com/kicad/code/kicad/-/blob/c5a2b86379d3583a47e0e4ee5ef64dc898d68e75/include/gal/opengl/gl_utils.h#L49
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@vadz pushed 4 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I think
SetSwapIntervalneeds to be implemented in each GL backend, not justwxGLCanvasX11::GLXSetSwapInterval.
I may have forgotten (or just misunderstood) things but I thought that we wanted to add it to allow customizing setting of the swap interval to 0 done right now in Unix (GLX and EGL) backends. Do we really need it elsewhere? It wouldn't be that difficult to call wglSwapIntervalEXT() under Windows and apparently there is CGLSetParameter(kCGLCPSwapInterval) for macOS, but would this be really useful there? Will KiCad use this?
And I don't think the interval should be changed inside
SwapBuffers.
Note that this is only done once. It's a way to allow setting the interval before it can be applied. Is it still a problem?
For Wayland, I think a solution similar to SDL can be implemented (see #24977 (comment))
This seems complicated and fragile :-( The original commit message speaks about "upcoming protocols that should improve the situation", would anybody know if anything has happened since then (2021)?
glXSwapIntervalEXTfunction may exist in the client library, butGLX_EXT_swap_control/GLX_EXT_swap_control_tearextensions may not supported by the driver.
Thanks, this is definitely a good point, I've updated this PR with a better check. I've also added a check for MESA extension, although I'm unable to test this because all my systems support EXT_swap_control — but it looks like it shouldn't do any harm. I didn't add support for GLX_SGI_swap_control, even though it would be easy to do, of course, because it looks like this one shouldn't be relevant any longer.
Finally, I've rebased everything on master.
Next steps are:
GLXDontSetSwapInterval() for EGL backend (simple to do, might be useful?).GLXSetSwapInterval() with arbitrary interval for EGL too and do something like what SDL does, but I'm still not sure if this is really a wise thing to do — and would definitely welcome any better ideas!—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
This would need to be redone once #26023 is merged, but I am still not sure about (4) (and also (1) and (2)...) from above.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()