Browse Source

MeshTools, Shaders: adapt thresholds for SwiftShader.

The Phong bugfix causes some rounding errors to be larger than before.
pull/470/head
Vladimír Vondruš 6 years ago
parent
commit
2b36fd2136
  1. 2
      src/Magnum/MeshTools/Test/CompileGLTest.cpp
  2. 10
      src/Magnum/Shaders/Test/PhongGLTest.cpp

2
src/Magnum/MeshTools/Test/CompileGLTest.cpp

@ -762,7 +762,7 @@ template<class T> void CompileGLTest::threeDimensions() {
_framebuffer.read({{}, {32, 32}}, {PixelFormat::RGBA8Unorm}),
Utility::Directory::join(COMPILEGLTEST_TEST_DIR, "phong-flat.tga"),
/* SwiftShader has some minor off-by-one precision differences */
(DebugTools::CompareImageToFile{_manager, 0.25f, 0.0079f}));
(DebugTools::CompareImageToFile{_manager, 0.5f, 0.0079f}));
} else if(data.flags & Flag::GeneratedSmoothNormals) {
_framebuffer.clear(GL::FramebufferClear::Color);
_phong

10
src/Magnum/Shaders/Test/PhongGLTest.cpp

@ -314,10 +314,10 @@ constexpr struct {
{"diffuse + normal", "instanced-normal.tga", Phong::Flag::NormalTexture,
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
/* AMD has one off pixel, llvmpipe more */
94.0f, 0.333f,
94.5f, 0.333f,
#else
/* WebGL 1 doesn't have 8bit renderbuffer storage */
94.0f, 0.132f,
94.5f, 0.132f,
#endif
}
};
@ -1126,7 +1126,7 @@ void PhongGLTest::renderShininess() {
Utility::Directory::join({_testDir, "PhongTestFiles", "shininess0-overflow.tga"}),
/* The threshold = 0.001 case has a slight reddish tone on
SwiftShader; ARM Mali has one pixel off */
(DebugTools::CompareImageToFile{_manager, 255.0f, 1.475f}));
(DebugTools::CompareImageToFile{_manager, 255.0f, 1.476f}));
}
}
@ -1364,10 +1364,10 @@ void PhongGLTest::renderLowLightAngle() {
CORRADE_SKIP("AnyImageImporter / TgaImageImporter plugins not found.");
#if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL))
const Float maxThreshold = 0.0f, meanThreshold = 0.0f;
const Float maxThreshold = 63.0f, meanThreshold = 0.36f;
#else
/* WebGL 1 doesn't have 8bit renderbuffer storage, so it's way worse */
const Float maxThreshold = 0.0f, meanThreshold = 0.0f;
const Float maxThreshold = 63.0f, meanThreshold = 0.36f;
#endif
CORRADE_COMPARE_WITH(
/* Dropping the alpha channel, as it's always 1.0 */

Loading…
Cancel
Save