|
|
|
|
@ -545,11 +545,17 @@ void DistanceFieldGlyphCacheGLTest::setImageArray() {
|
|
|
|
|
|
|
|
|
|
/* The format may be three-component, consider just the first channel */ |
|
|
|
|
Containers::StridedArrayView3D<const char> pixels = actual.pixels(); |
|
|
|
|
{ |
|
|
|
|
#ifdef MAGNUM_TARGET_GLES |
|
|
|
|
CORRADE_EXPECT_FAIL_IF(data.sourceOffset.z() != 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_WITH((Containers::arrayCast<2, const UnsignedByte>(pixels.prefix({pixels.size()[0], pixels.size()[1], 1})).exceptPrefix(data.offset)), |
|
|
|
|
Utility::Path::join(TEXTURETOOLS_DISTANCEFIELDGLTEST_DIR, "output.tga"), |
|
|
|
|
/* Same threshold as in TextureTools DistanceFieldGLTest */ |
|
|
|
|
(DebugTools::CompareImageToFile{_manager, 1.0f, 0.178f})); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void DistanceFieldGlyphCacheGLTest::setImageEdgeClamp() { |
|
|
|
|
@ -603,9 +609,15 @@ void DistanceFieldGlyphCacheGLTest::setImageEdgeClamp() {
|
|
|
|
|
|
|
|
|
|
/* On the left side the pixels should be completely zero, without the right
|
|
|
|
|
side leaking for example due to accidental repeat clamp */ |
|
|
|
|
{ |
|
|
|
|
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) |
|
|
|
|
CORRADE_EXPECT_FAIL_IF(GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader, |
|
|
|
|
"SwiftShader is trash and wraps around out-of-bounds texelFetch()."); |
|
|
|
|
#endif |
|
|
|
|
CORRADE_COMPARE(dst[0][0], '\x00'); |
|
|
|
|
CORRADE_COMPARE(dst[1][0], '\x00'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES2 |
|
|
|
|
void DistanceFieldGlyphCacheGLTest::setImageEdgeClampArray() { |
|
|
|
|
@ -652,9 +664,15 @@ void DistanceFieldGlyphCacheGLTest::setImageEdgeClampArray() {
|
|
|
|
|
|
|
|
|
|
/* On the left side the pixels should be completely zero, without the right
|
|
|
|
|
side leaking for example due to accidental repeat clamp */ |
|
|
|
|
{ |
|
|
|
|
#ifdef MAGNUM_TARGET_GLES |
|
|
|
|
CORRADE_EXPECT_FAIL_IF(GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader, |
|
|
|
|
"SwiftShader is trash and wraps around out-of-bounds texelFetch()."); |
|
|
|
|
#endif |
|
|
|
|
CORRADE_COMPARE(dst[0][0], '\x00'); |
|
|
|
|
CORRADE_COMPARE(dst[1][0], '\x00'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
const UnsignedByte InputData[]{ |
|
|
|
|
|