From 94c31b13e28718b9487f48e3a4eda38ec5cc51f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 16 Oct 2023 15:42:32 +0200 Subject: [PATCH] TextureTools: it's not SwiftShader, it's Luminance not being renderable. And the thing that changed for SwiftShader 4.1 was added EXT_texture_rg support, which made the test work. So no, this was not a SwiftShader bug at all. --- .../TextureTools/Test/DistanceFieldGLTest.cpp | 36 ++++--------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp index 20fed29f3..4ce57741b 100644 --- a/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp +++ b/src/Magnum/TextureTools/Test/DistanceFieldGLTest.cpp @@ -85,10 +85,6 @@ const struct { {"with offset", {128, 96}, {64, 32}}, }; -#ifdef MAGNUM_TARGET_GLES -using namespace Containers::Literals; /* for SwiftShader detection */ -#endif - DistanceFieldGLTest::DistanceFieldGLTest() { addTests({&DistanceFieldGLTest::construct, &DistanceFieldGLTest::constructCopy, @@ -198,7 +194,7 @@ void DistanceFieldGLTest::run() { if(GL::Context::current().isExtensionSupported()) outputFormat = GL::TextureFormat::R8; else - outputFormat = GL::TextureFormat::Luminance; /** @todo Luminance8 */ + outputFormat = GL::TextureFormat::RGBA; #else const GL::TextureFormat outputFormat = GL::TextureFormat::RGBA; #endif @@ -213,29 +209,11 @@ void DistanceFieldGLTest::run() { MAGNUM_VERIFY_NO_GL_ERROR(); - std::ostringstream out; - { - Error redirectError{&out}; - distanceField(input, output, - Range2Di::fromSize(data.offset, Vector2i{64}) - #ifdef MAGNUM_TARGET_GLES - , inputImage->size() - #endif - ); - } - - #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. */ - if(GL::Context::current().versionString().contains("SwiftShader 4.0.0"_s)) { - CORRADE_COMPARE(out.str(), "TextureTools::DistanceField: cannot render to given output texture, unexpected framebuffer status GL::Framebuffer::Status::IncompleteAttachment\n"); - CORRADE_SKIP("SwiftShader 4.0.0 has a bug where the framebuffer is considered incomplete."); - } else - #endif - { - CORRADE_COMPARE(out.str(), ""); - } + distanceField(input, output, Range2Di::fromSize(data.offset, Vector2i{64}) + #ifdef MAGNUM_TARGET_GLES + , inputImage->size() + #endif + ); Containers::Optional actualOutputImage; #ifndef MAGNUM_TARGET_GLES2 @@ -244,7 +222,7 @@ void DistanceFieldGLTest::run() { if(GL::Context::current().isExtensionSupported()) actualOutputImage = Image2D{GL::PixelFormat::Red, GL::PixelType::UnsignedByte}; else - actualOutputImage = Image2D{PixelFormat::R8Unorm}; + actualOutputImage = Image2D{PixelFormat::RGBA8Unorm}; #else actualOutputImage = Image2D{PixelFormat::RGBA8Unorm}; #endif