From c848b6576813f5d93c51a44f73c0eb7cb4eff74e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 20 Apr 2025 16:51:49 +0200 Subject: [PATCH] Text,TextureTools: more SwiftShader XFAILs. Do I look like I want to deal with broken software on a Sunday? Exactly. --- .../Test/DistanceFieldGlyphCacheGLTest.cpp | 34 ++++++++++++++----- .../TextureTools/Test/DistanceFieldGLTest.cpp | 4 +++ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp b/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp index 80917aef4..955329961 100644 --- a/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp +++ b/src/Magnum/Text/Test/DistanceFieldGlyphCacheGLTest.cpp @@ -545,10 +545,16 @@ void DistanceFieldGlyphCacheGLTest::setImageArray() { /* The format may be three-component, consider just the first channel */ Containers::StridedArrayView3D pixels = actual.pixels(); - CORRADE_COMPARE_WITH((Containers::arrayCast<2, const UnsignedByte>(pixels.prefix({pixels.size()[0], pixels.size()[1], 1})).exceptPrefix(data.offset)), - Utility::Path::join(TEXTURETOOLS_DISTANCEFIELDGLTEST_DIR, "output.tga"), - /* Same threshold as in TextureTools DistanceFieldGLTest */ - (DebugTools::CompareImageToFile{_manager, 1.0f, 0.178f})); + { + #ifdef MAGNUM_TARGET_GLES + CORRADE_EXPECT_FAIL_IF(data.sourceOffset.z() != 0 && GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader, + "SwiftShader is trash and doesn't implement reading from non-zero array layers."); + #endif + CORRADE_COMPARE_WITH((Containers::arrayCast<2, const UnsignedByte>(pixels.prefix({pixels.size()[0], pixels.size()[1], 1})).exceptPrefix(data.offset)), + Utility::Path::join(TEXTURETOOLS_DISTANCEFIELDGLTEST_DIR, "output.tga"), + /* Same threshold as in TextureTools DistanceFieldGLTest */ + (DebugTools::CompareImageToFile{_manager, 1.0f, 0.178f})); + } } #endif @@ -603,8 +609,14 @@ void DistanceFieldGlyphCacheGLTest::setImageEdgeClamp() { /* On the left side the pixels should be completely zero, without the right side leaking for example due to accidental repeat clamp */ - CORRADE_COMPARE(dst[0][0], '\x00'); - CORRADE_COMPARE(dst[1][0], '\x00'); + { + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) + CORRADE_EXPECT_FAIL_IF(GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader, + "SwiftShader is trash and wraps around out-of-bounds texelFetch()."); + #endif + CORRADE_COMPARE(dst[0][0], '\x00'); + CORRADE_COMPARE(dst[1][0], '\x00'); + } } #ifndef MAGNUM_TARGET_GLES2 @@ -652,8 +664,14 @@ void DistanceFieldGlyphCacheGLTest::setImageEdgeClampArray() { /* On the left side the pixels should be completely zero, without the right side leaking for example due to accidental repeat clamp */ - CORRADE_COMPARE(dst[0][0], '\x00'); - CORRADE_COMPARE(dst[1][0], '\x00'); + { + #ifdef MAGNUM_TARGET_GLES + CORRADE_EXPECT_FAIL_IF(GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader, + "SwiftShader is trash and wraps around out-of-bounds texelFetch()."); + #endif + CORRADE_COMPARE(dst[0][0], '\x00'); + CORRADE_COMPARE(dst[1][0], '\x00'); + } } #endif diff --git a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp index e5f47c3fe..8394dd346 100644 --- a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp +++ b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp @@ -412,6 +412,10 @@ void DistanceFieldGLTest::run() { else pixels = Containers::arrayCast<2, UnsignedByte>(pixels3); + #ifdef MAGNUM_TARGET_GLES + CORRADE_EXPECT_FAIL_IF(data.layer != 0 && GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader, + "SwiftShader is trash and doesn't implement reading from non-zero array layers."); + #endif CORRADE_COMPARE_WITH( pixels, Utility::Path::join(_testDir, "output.tga"),