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

Wayland display issue on Qt6 #84

Open
pbartfai opened this issue Jun 2, 2024 · 4 comments
Open

Wayland display issue on Qt6 #84

pbartfai opened this issue Jun 2, 2024 · 4 comments
Labels

Comments

@pbartfai
Copy link
Collaborator

pbartfai commented Jun 2, 2024

Describe the bug
Backing store is not working on Qt6 using QOpenGLWidget

To Reproduce
to build run the following command:
qmake-qt6.sh -spec linux-g++-64 ; make clean all

run the following command
./LDView -platform wayland ../m6459.ldr

Expected behavior
Clear background is expected

Screenshots
image

Platform (please complete the following information):

  • Linux
  • Qt 6.x

Additional context
Same issue ont Qt5 if option QOPENGLWIDGET is enabled.
Without option QOPENGLWIDGET blank window is displayed on Wayland.

@pbartfai
Copy link
Collaborator Author

pbartfai commented Jun 3, 2024

Changing the memory usage to high or medium will cause total mess. With low memory usage, the display is better, but not perfect.
Problem experienced with QOpenGLWidget on both Wayland and xcb.
image

@pbartfai
Copy link
Collaborator Author

pbartfai commented Jun 3, 2024

When rotating the model the earlier phases are not cleared, background is not refreshed:
image
image

@pbartfai
Copy link
Collaborator Author

pbartfai commented Jun 8, 2024

Problem could be recreated with Qt6 example openglwindow (https://doc.qt.io/qt-6/qtopengl-openglwindow-example.html)
Similar issues on the following Qt5 examples:

  • paintedwindows
  • threadedqopenglwidget
  • legacy/grabber

@tcobbs
Copy link
Owner

tcobbs commented Jun 16, 2024

The ghosting problem sounds like a problem with double buffering, but it could also be a problem with clearing the color buffers in the back buffer.

The memory usage problems are probably related to display lists, since changing the memory usage setting mainly changes what gets stored in display lists. (The high memory usage setting also flattens the conditional line geometry to the top level to allow for multithreaded conditional processing.)

Given that you see the same problems in the Qt examples, I would say that either Qt itself is broken, or that Wayland is broken. If I had to guess, they never bothered to test OpenGL 1.x functionality.

Unfortunately, I can't think of anything to do to fix LDView. You may be able to fiddle around with the QOpenGLWidget's buffering settings to fix the ghosting, and you may not (since it certainly appears to be Qt and/or Wayland that is broken, not LDView).

For the memory usage problems, I feel that the same applies, but you could test my supposition about display lists by modifying the code to never set the display list flags to true when running in Qt6. I think that the best way to do this is to just use #ifdefs in TREMainModel.h to override setCompilePartsFlag and setCompileAllFlag to not do anything. (The flags default to false, so preventing them from being set to true would disable display list usage.) If this works, go ahead and rearrange the code so that those two functions are next to each other so you only need one #ifdef/#else pair.

If you can't figure out how to fix the ghosting by tweaking the QOpenGLWidget's settings, try calling setSlowClear(true) on the LDrawModelViewer instance.

Regarding snapshot saves, I don't even know where to begin. Once again, I strongly suspect that the problem is buggy Qt and/or Wayland, and I don't have any real hope of figuring out a fix.

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

No branches or pull requests

2 participants