diff --git a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp index 2a5d43d5d..7efd7f114 100644 --- a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp +++ b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp @@ -324,8 +324,15 @@ void TextureImageGLTest::subImage2DArray() { CORRADE_COMPARE(image.format(), pixelFormatWrap(GL::PixelFormat::RGBA)); CORRADE_COMPARE(GL::PixelType(image.formatExtra()), GL::PixelType::UnsignedByte); CORRADE_COMPARE(image.pixelSize(), 4); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), - Containers::arrayView(Data2D), TestSuite::Compare::Container); + + { + #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_AS(Containers::arrayCast(image.data()), + Containers::arrayView(Data2D), TestSuite::Compare::Container); + } } void TextureImageGLTest::subImage2DArrayNotReadable() { @@ -558,9 +565,16 @@ void TextureImageGLTest::subImage2DFloat() { CORRADE_COMPARE(image.format(), pixelFormatWrap(GL::PixelFormat::Red)); CORRADE_COMPARE(GL::PixelType(image.formatExtra()), GL::PixelType::Float); CORRADE_COMPARE(image.pixelSize(), 4); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), - Containers::arrayView(Data2DFloat), - TestSuite::Compare::Container); + + { + #ifdef MAGNUM_TARGET_GLES + CORRADE_EXPECT_FAIL_IF(data.level != 0 && GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader, + "SwiftShader is trash and doesn't implement texelFetch() from non-zero levels."); + #endif + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), + Containers::arrayView(Data2DFloat), + TestSuite::Compare::Container); + } } void TextureImageGLTest::subImage2DFloatGeneric() { @@ -582,9 +596,16 @@ void TextureImageGLTest::subImage2DFloatGeneric() { CORRADE_COMPARE(image.format(), PixelFormat::R32F); CORRADE_COMPARE(image.formatExtra(), 0); CORRADE_COMPARE(image.pixelSize(), 4); - CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), - Containers::arrayView(Data2DFloat), - TestSuite::Compare::Container); + + { + #ifdef MAGNUM_TARGET_GLES + CORRADE_EXPECT_FAIL_IF(data.level != 0 && GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader, + "SwiftShader is trash and doesn't implement texelFetch() from non-zero levels."); + #endif + CORRADE_COMPARE_AS(Containers::arrayCast(image.data()), + Containers::arrayView(Data2DFloat), + TestSuite::Compare::Container); + } } const Half Data2DHalf[] = { 1.0_h, diff --git a/src/Magnum/Text/Test/GlyphCacheGLTest.cpp b/src/Magnum/Text/Test/GlyphCacheGLTest.cpp index 070433c3e..1ffa775e8 100644 --- a/src/Magnum/Text/Test/GlyphCacheGLTest.cpp +++ b/src/Magnum/Text/Test/GlyphCacheGLTest.cpp @@ -650,12 +650,21 @@ void GlyphCacheGLTest::setImageArray() { CORRADE_COMPARE_AS(image0, (ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData03}), DebugTools::CompareImage); - CORRADE_COMPARE_AS(image1, - (ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData1}), - DebugTools::CompareImage); - CORRADE_COMPARE_AS(image2, - (ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData2}), - DebugTools::CompareImage); + { + #ifdef MAGNUM_TARGET_GLES + CORRADE_EXPECT_FAIL_IF(GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader, + "SwiftShader is trash and doesn't implement reading from non-zero array layers."); + #endif + CORRADE_COMPARE_AS(image1, + (ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData1}), + DebugTools::CompareImage); + CORRADE_COMPARE_AS(image2, + (ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData2}), + DebugTools::CompareImage); + } + /* This is broken on SwiftShader too, returning the first layer (or all + zeros) but since we expect the same as first layer (which is all zeros), + it passes */ CORRADE_COMPARE_AS(image3, (ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData03}), DebugTools::CompareImage);