Browse Source

DebugTools: expect more differences in renderer tests on ARM Mali.

This makes the tests pass 100%.
pull/331/head
Vladimír Vondruš 7 years ago
parent
commit
6f3c6f85ad
  1. 17
      src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp
  2. 19
      src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp

17
src/Magnum/DebugTools/Test/ForceRendererGLTest.cpp

@ -23,6 +23,7 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/Containers/Optional.h>
#include <Corrade/PluginManager/Manager.h>
#include <Corrade/Utility/Directory.h>
@ -43,6 +44,10 @@
#include "configure.h"
#ifdef CORRADE_TARGET_ANDROID
#include "Magnum/GL/Context.h"
#endif
namespace Magnum { namespace DebugTools { namespace Test { namespace {
struct ForceRendererGLTest: GL::OpenGLTester {
@ -107,10 +112,20 @@ void ForceRendererGLTest::render2D() {
!(_manager.loadState("TgaImporter") & PluginManager::LoadState::Loaded))
CORRADE_SKIP("AnyImageImporter / TgaImageImporter plugins not found.");
/* ARM Mali G71 (Huawei P10) has some rounding differences causing the
the arrowhead to be on a different place (but the rest is okay and the
3D case matches exactly), however to avoid false negatives elsewhere I'm
making it conditional. */
Containers::Optional<CompareImageToFile> comparator{Containers::InPlaceInit, _manager};
#ifdef CORRADE_TARGET_ANDROID
if(GL::Context::current().detectedDriver() & GL::Context::DetectedDriver::ArmMali)
comparator.emplace(_manager, 79.0f, 0.22f);
#endif
CORRADE_COMPARE_WITH(
framebuffer.read({{}, {64, 64}}, {PixelFormat::RGBA8Unorm}),
Utility::Directory::join(DEBUGTOOLS_TEST_DIR, "ForceRenderer2D.tga"),
CompareImageToFile{_manager});
*comparator);
}
void ForceRendererGLTest::render3D() {

19
src/Magnum/DebugTools/Test/ObjectRendererGLTest.cpp

@ -23,6 +23,7 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Corrade/Containers/Optional.h>
#include <Corrade/PluginManager/Manager.h>
#include <Corrade/Utility/Directory.h>
@ -43,6 +44,10 @@
#include "configure.h"
#ifdef CORRADE_TARGET_ANDROID
#include "Magnum/GL/Context.h"
#endif
namespace Magnum { namespace DebugTools { namespace Test { namespace {
struct ObjectRendererGLTest: GL::OpenGLTester {
@ -153,11 +158,21 @@ void ObjectRendererGLTest::render3D() {
!(_manager.loadState("TgaImporter") & PluginManager::LoadState::Loaded))
CORRADE_SKIP("AnyImageImporter / TgaImporter plugins not found.");
/* Intel Windows drivers misplace one pixel here. Nothing serious.
ARM Mali G71 (Huawei P10) has some rounding differences causing the
the bottom blue line to be on a different place (but the rest is
okay and the 2D case matches exactly), however to avoid false negatives
elsewhere I'm making it conditional. */
Containers::Optional<CompareImageToFile> comparator{Containers::InPlaceInit, _manager, 71.6f, 0.018f};
#ifdef CORRADE_TARGET_ANDROID
if(GL::Context::current().detectedDriver() & GL::Context::DetectedDriver::ArmMali)
comparator.emplace(_manager, 127.6f, 0.54f);
#endif
CORRADE_COMPARE_WITH(
framebuffer.read({{}, {64, 64}}, {PixelFormat::RGBA8Unorm}),
Utility::Directory::join(DEBUGTOOLS_TEST_DIR, "ObjectRenderer3D.tga"),
/* Intel Windows drivers misplace one pixel here. Nothing serious. */
(CompareImageToFile{_manager, 71.6f, 0.018f}));
*comparator);
}
}}}}

Loading…
Cancel
Save