From 2f23b0cd9c93bd7f7e669096ffdca11f7b4bbafb 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 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 f70c6e5f648..5c7bce5b61e 100644 --- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp +++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp @@ -2163,13 +2163,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"); @@ -2177,6 +2170,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, @@ -5430,13 +5428,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"); @@ -5444,6 +5435,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;