Fix lancelot GL painting test for GLES

RGB10 internal texture format is not supported on GLES, use RGB10_A2
instead.

Pick-to: 6.0
Change-Id: Ib43eb99b170f441e886be50d29a6a5f7696c05c7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
Eirik Aavitsland 2021-01-11 11:21:05 +01:00
parent b59f77aab4
commit 167bcafcb6

View File

@ -42,6 +42,9 @@
#ifndef GL_RGB10
#define GL_RGB10 0x8052
#endif
#ifndef GL_RGB10_A2
#define GL_RGB10_A2 0x8059
#endif
class tst_Lancelot : public QObject
{
@ -355,15 +358,15 @@ void tst_Lancelot::runTestSuite(GraphicsEngine engine, QImage::Format format, co
win.setSurfaceType(QSurface::OpenGLSurface);
win.setFormat(contextFormat);
win.create();
QOpenGLFramebufferObjectFormat fmt;
fmt.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
fmt.setSamples(4);
if (format == QImage::Format_BGR30)
fmt.setInternalTextureFormat(GL_RGB10);
QOpenGLContext ctx;
ctx.setFormat(contextFormat);
QVERIFY(ctx.create());
QVERIFY(ctx.makeCurrent(&win));
QOpenGLFramebufferObjectFormat fmt;
fmt.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);
fmt.setSamples(4);
if (format == QImage::Format_BGR30)
fmt.setInternalTextureFormat(ctx.isOpenGLES() ? GL_RGB10_A2 : GL_RGB10);
QOpenGLFramebufferObject fbo(800, 800, fmt);
fbo.bind();
QOpenGLPaintDevice pdv(800, 800);