See #23512.
https://github.com/wxWidgets/wxWidgets/pull/23909
(2 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Merged #23909 into master.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
There's a problem using eglSwapInterval here because it depends on the currently selected EGL context (from wxGLContext::SetCurrent / eglMakeCurrent) and there's no guarantee that the appropriate context is bound inside wxGLCanvasEGL::OnWLFrameCallback(). This may be a problem if the application is using multiple OpenGL contexts (not as strange as one may think since using e.g. wxWebView creates a context).
The failure you observed in #23512 (comment) is probably due to the same reason, the right context was not selected.
This should probably be moved inside wxGLContext::SwapBuffers (like in #23898) since we can be sure that the right context is selected there.
The call to eglSwapInterval
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
There's a problem using
eglSwapIntervalhere because it depends on the currently selected EGL context (fromwxGLContext::SetCurrent/eglMakeCurrent) and there's no guarantee that the appropriate context is bound insidewxGLCanvasEGL::OnWLFrameCallback.
Oops.
The failure you observed in #23512 (comment) is probably due to the same reason, the right context was not selected.
If so, it seems like we ought to do this in wxGLContext::SetCurrent()? But I am not sure that it fails because the right context isn't selected: why would it fail for this other context? I.e. I'd understand if it didn't work, in the sense that it didn't change the swap interval, but the function actually failed, with an error.
This should probably be moved inside
wxGLContext::SwapBuffers(like in #23898) since we can be sure that the right context is selected there.
But this is what we had started with and it didn't work. I'm not sure if it's because the context wasn't current or some other reason, but I don't know how to make it work there. If you do, please let me know!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
The failure you observed in #23512 (comment) is probably due to the same reason, the right context was not selected.
If so, it seems like we ought to do this in wxGLContext::SetCurrent()? But I am not sure that it fails because the right context isn't selected: why would it fail for this other context? I.e. I'd understand if it didn't work, in the sense that it didn't change the swap interval, but the function actually failed, with an error.
This should probably be moved inside wxGLContext::SwapBuffers (like in #23898) since we can be sure that the right context is selected there.
But this is what we had started with and it didn't work. I'm not sure if it's because the context wasn't current or some other reason, but I don't know how to make it work there. If you do, please let me know!
As far as I can see, on Wayland, we never called eglSwapInterval from wxGLContext::SwapBuffers, but rather from wxGLCanvasEGL::CreateSurface. Calling eglSwapInterval from there has be same problem, there's no guarantee that the right EGL context is current. In particular, for simple applications, if you try to call eglSwapInterval from wxGLCanvasEGL::CreateSurface it will fail with error EGL_BAD_CONTEXT because no context has been set yet.
Calling eglSwapInterval from either wxGLContext::SetCurrent and wxGLContext::SwapBuffers should work.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
I thought I tried calling from SwapBuffers() too but maybe you're right and I didn't. Anyhow, it's not difficult to call it from there and it looks preferable to call it from the same place for X11 and Wayland cases anyhow, so I've done it now in #24014.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()