Describe the bug
In v3.1.5, the double buffer of wxGLCanvas always appears to be active even when it hasn't been requested. This behaviour is certainly different to that of v3.1.4.
Both v3.1.4 and v3.1.5 show signs of lag when double buffer is used. This is observed when resizing the window.
Expected vs observed behaviour
I admit I'm assuming I'm correct when I state the expected behaviour but I'm not 100% sure. One thing is for certain, the behaviour between v3.1.4 and v3.1.5 is different.
Expected:
Note: v3.1.4 provides the expected behaviour described in (1) but both v3.1.4 and v3.1.5 show the lag in (2).
Observed:
Patch or snippet allowing to reproduce the problem
This problem can be reproduced using the OpenGL "Cube" sample with a few small incremental changes as follows:
Test 1 Changes (adds red background to the scene to show lag):
glClearColor(1.0f, 0.0f, 0.0f, 1.0f); to the TestGLContext constructor just before the CheckGLError(); statement.Test 2 Changes (disables DoubleBuffer):
int attribList[] = { WX_GL_RGBA, 0 }; under the int stereoAttribList[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_STEREO, 0 }; statement of MyFrame constructor.new TestGLCanvas(this, stereoWindow ? stereoAttribList : NULL); to read new TestGLCanvas(this, stereoWindow ? stereoAttribList : attribList); of the MyFrame constructor.Test 3 Changes (removes SwapBuffers):
SwapBuffers() from the TestGLCanvas::OnPaint function.To Reproduce
Test 1 (shows lag in both v3.1.4 and v3.1.5):
Test 2 (shows lag in v3.1.5 only and that double buffer still seems to be active/v3.1.4 is not effected by this issue):
Test 3 (shows SwapBuffers is required when double buffer is disabled in v3.1.5 and not v3.1.4):
Platform and version information
Additional information
I ran a git bisect between v3.1.4 and v3.1.5 and the result is shown below.
7cd12a2bd6566b36be5579a370b52ac18f986863 is the first bad commit
commit 7cd12a2bd6566b36be5579a370b52ac18f986863
Author: Scott Talbert <s...@techie.net>
Date: Fri Aug 28 11:59:27 2020 -0400
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
7cd12a2 (Add EGL-based backend for wxGLCanvas, 2020-08-28) wasn't supposed to change the behaviour when not using Wayland, so if it did, this would be indeed a regression. And I guess you use X11 and not Wayland, because otherwise wxGLCanvas wouldn't work at all for you with 3.1.4, but, just to be sure, could you please confirm this?
cc @swt2c
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
No. I'm using Wayland.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
But 3.1.4 definitely didn't support OpenGL at all under Wayland, see https://github.com/wxWidgets/wxWidgets/blob/6cdaedd42ba59331b3dc4ead50e0bac76ae14c19/src/gtk/glcanvas.cpp#L164-L169
Do you use 3.1.5 with Wayland and 3.1.4 with X11 or am I missing something here?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Now you have mentioned it, I did remember having to use GDK_BACKEND=x11 when I used v3.1.4 originally under Ubuntu 21.04. But I haven't seen the error I got when using it with Ubuntu 21.10.
With Ubuntu 21.10, I started with wxWidgets v3.1.5 and observed this issue. I then downloaded v3.1.4 and tested that.
But I'm definitely using Wayland. I just switched to X11 and it worked exactly the same. The results were also the same as described in the initial text above.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Yeah, I can confirm that when using the EGL backend, disabling double buffering doesn't do anything (currently). It's not clear to me how to disable double buffering, though, or even if it is possible with EGL.
@gsxruk, if you would prefer to use the GLX backend, you can compile wxWidgets with configure --disable-glcanvasegl and you should see the 3.1.4 behavior. However, it won't work with Wayland (without forcing XWayland).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
With recent wx versions it's possible to use GLX implementation even in the builds with Wayland/EGL support by calling wxGLCanvas::PreferGLX() so you can do this if EGL really doesn't work for you without recompiling.
I don't think it's possible to avoid double buffering with EGL, the closest thing I can see is setting EGL_SWAP_BEHAVIOR to EGL_BUFFER_PRESERVED, but I haven't tried it.
I'm not sure if wx should, or could, do anything about it, but in any case it's not a regression.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()