From 598db6f4b120816ce2b304f834e75c26e427dfb3 Mon Sep 17 00:00:00 2001 From: Lauri Pohjanheimo Date: Tue, 4 Feb 2025 09:38:22 +0200 Subject: [PATCH] SwiftShader sw check added to enable tests on hardware On CI an Android emulator with SwiftShader software graphics implementation is used. SwiftShader implementation is unable to emulate this OpenGL functionality. QSKIP the test if it is run in Android platform, OpenGL and SwiftShader sw graphics implementation is found. Task-number: QTQAINFRA-6333 Task-number: QTQAINFRA-6334 Pick-to: 6.8 Change-Id: I560aa796e7f364e645ebb41f89120673a0f59a5b Reviewed-by: Assam Boudjelthia --- tests/auto/gui/rhi/qrhi/tst_qrhi.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp index f3d0781b0ee..2c98370bbd9 100644 --- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp +++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp @@ -2089,13 +2089,6 @@ void tst_QRhi::renderToTextureTextureArray() QFETCH(QRhi::Implementation, impl); QFETCH(QRhiInitParams *, initParams); -#ifdef Q_OS_ANDROID - if (impl == QRhi::OpenGLES2) { - QSKIP("This test fails with OpenGLES software rendering on Android emulators, " - "see QTBUG-132934."); - } -#endif - QScopedPointer rhi(QRhi::create(impl, initParams, QRhi::Flags(), nullptr)); if (!rhi) QSKIP("QRhi could not be created, skipping testing rendering"); @@ -2103,6 +2096,11 @@ void tst_QRhi::renderToTextureTextureArray() if (!rhi->isFeatureSupported(QRhi::TextureArrays)) QSKIP("TextureArrays is not supported with this backend, skipping test"); + if (isAndroidOpenGLSwiftShader(impl, rhi.get())) { + QSKIP("SwiftShader software acceleration is used which does not support this OpenGLES " + "feature. See QTBUG-132934"); + } + const QSize outputSize(512, 256); const int ARRAY_SIZE = 8; QScopedPointer texture(rhi->newTextureArray(QRhiTexture::RGBA8, @@ -5284,13 +5282,6 @@ void tst_QRhi::threeDimTexture() QFETCH(QRhi::Implementation, impl); QFETCH(QRhiInitParams *, initParams); -#ifdef Q_OS_ANDROID - if (impl == QRhi::OpenGLES2) { - QSKIP("This test fails with OpenGLES software rendering on Android emulators, " - "see QTBUG-132934."); - } -#endif - QScopedPointer rhi(QRhi::create(impl, initParams)); if (!rhi) QSKIP("QRhi could not be created, skipping testing 3D textures"); @@ -5298,6 +5289,11 @@ void tst_QRhi::threeDimTexture() if (!rhi->isFeatureSupported(QRhi::ThreeDimensionalTextures)) QSKIP("Skipping testing 3D textures because they are reported as unsupported"); + if (isAndroidOpenGLSwiftShader(impl, rhi.get())) { + QSKIP("SwiftShader software acceleration is used which does not support this OpenGLES " + "feature. See QTBUG-132934"); + } + const int WIDTH = 512; const int HEIGHT = 256; const int DEPTH = 128;