From 361d87cd9e51848f7096050fb3d315b43166cd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 10 Feb 2022 13:26:40 +0100 Subject: [PATCH] Shaders,TextureTools: XFAIL tests that hit weird bugs on SwiftShader 4.0. No patience to investigate. --- src/Magnum/Shaders/Test/PhongGLTest.cpp | 14 ++++++++++++- .../TextureTools/Test/DistanceFieldGLTest.cpp | 21 ++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Shaders/Test/PhongGLTest.cpp b/src/Magnum/Shaders/Test/PhongGLTest.cpp index 5f5c3709e..d40cd27a1 100644 --- a/src/Magnum/Shaders/Test/PhongGLTest.cpp +++ b/src/Magnum/Shaders/Test/PhongGLTest.cpp @@ -392,6 +392,7 @@ constexpr struct { }; #endif +using namespace Containers::Literals; using namespace Math::Literals; const struct { @@ -3250,7 +3251,18 @@ void PhongGLTest::renderLightsSetOneByOne() { .setProjectionMatrix(Matrix4::perspectiveProjection(80.0_degf, 1.0f, 0.1f, 20.0f)) .draw(plane); - MAGNUM_VERIFY_NO_GL_ERROR(); + #ifdef MAGNUM_TARGET_GLES + { + /* The setLightPosition(1) is the first call that causes the error. + Works with 4.1, didn't find any commit in between that would clearly + affect this. */ + CORRADE_EXPECT_FAIL_IF(GL::Context::current().versionString().contains("SwiftShader 4.0.0"_s), + "SwiftShader 4.0.0 has a bug where setting array uniform elements other than 0 causes GL_INVALID_OPERATION."); + MAGNUM_VERIFY_NO_GL_ERROR(); + if(GL::Context::current().versionString().contains("SwiftShader 4.0.0"_s)) + CORRADE_SKIP("Skipping the rest of the test."); + } + #endif const Image2D image = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); diff --git a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp index 9517ef7c2..57cb8fed9 100644 --- a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp +++ b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp @@ -49,6 +49,10 @@ #include "configure.h" +#ifdef MAGNUM_TARGET_GLES +#include /* for SwiftShader detection */ +#endif + namespace Magnum { namespace TextureTools { namespace Test { namespace { struct DistanceFieldGLTest: GL::OpenGLTester { @@ -64,6 +68,10 @@ struct DistanceFieldGLTest: GL::OpenGLTester { std::string _testDir; }; +#ifdef MAGNUM_TARGET_GLES +using namespace Containers::Literals; /* for SwiftShader detection */ +#endif + DistanceFieldGLTest::DistanceFieldGLTest() { addTests({&DistanceFieldGLTest::test}); @@ -162,7 +170,18 @@ void DistanceFieldGLTest::test() { #endif ); - MAGNUM_VERIFY_NO_GL_ERROR(); + #ifdef MAGNUM_TARGET_GLES + { + /* Probably due to the luminance target pixel format? Works with 4.1, + didn't find any commit in between that would clearly affect + this. */ + CORRADE_EXPECT_FAIL_IF(GL::Context::current().versionString().contains("SwiftShader 4.0.0"_s), + "SwiftShader 4.0.0 has a bug where the framebuffer is considered incomplete."); + MAGNUM_VERIFY_NO_GL_ERROR(); + if(GL::Context::current().versionString().contains("SwiftShader 4.0.0"_s)) + CORRADE_SKIP("Skipping the rest of the test."); + } + #endif Containers::Optional actualOutputImage; #ifndef MAGNUM_TARGET_GLES2