Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9.0
-
None
Description
The following program using a QOpenGLTexture renders correctly on Linux/X11, but not on Linux/Wayland (see attached PNGs):
#include <QApplication> #include <QMainWindow> #include <QOpenGLFunctions_2_1> #include <QOpenGLWidget> #include <QOpenGLTexture> class GLWidget final : public QOpenGLWidget, public QOpenGLFunctions_2_1 { auto initializeGL() -> void override { initializeOpenGLFunctions(); } auto paintGL() -> void override { glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); auto image = QImage{":/logo"}; auto texture = QOpenGLTexture{image.flipped()}; glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, texture.textureId()); glColor3d(1.0, 1.0, 1.0); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glBegin(GL_QUADS); auto tex2Vert = [&](auto s, auto t, auto x, auto y) { glTexCoord2d(s, t); glVertex2d(x, y); }; tex2Vert(0.0, 0.0, -1.0, -1.0); tex2Vert(1.0, 0.0, 1.0, -1.0); tex2Vert(1.0, 1.0, 1.0, 1.0); tex2Vert(0.0, 1.0, -1.0, 1.0); glEnd(); glDisable(GL_TEXTURE_2D); } }; auto main(int argc, char** argv) -> int { auto app = QApplication{argc, argv}; auto win = QMainWindow{}; auto widget = new GLWidget{}; win.setCentralWidget(widget); win.resize(500, 500); win.show(); return QApplication::exec(); }
Attached is a ZIP containing everything needed to reproduce.