From 280908398d793be0dc25181cff5394dd036e4d8d Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Mon, 11 Jan 2021 11:21:05 +0100 Subject: Fix lancelot GL painting test for GLES RGB10 internal texture format is not supported on GLES, use RGB10_A2 instead. Change-Id: Ib43eb99b170f441e886be50d29a6a5f7696c05c7 Reviewed-by: Allan Sandfeld Jensen (cherry picked from commit 167bcafcb6b1988047bec8b4d67c994fc8c85c14) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/other/lancelot/tst_lancelot.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/other/lancelot/tst_lancelot.cpp b/tests/auto/other/lancelot/tst_lancelot.cpp index 1f0066eebb..7a85e9c370 100644 --- a/tests/auto/other/lancelot/tst_lancelot.cpp +++ b/tests/auto/other/lancelot/tst_lancelot.cpp @@ -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); -- cgit v1.2.3