Browse Source

DebugTools,Text: SwiftShader is trash, should just ditch that thing.

I can use llvmpipe on the CI already, this rotten pile of crap is a
waste of energy.
pull/674/head
Vladimír Vondruš 1 year ago
parent
commit
1faefdbda0
  1. 37
      src/Magnum/DebugTools/Test/TextureImageGLTest.cpp
  2. 21
      src/Magnum/Text/Test/GlyphCacheGLTest.cpp

37
src/Magnum/DebugTools/Test/TextureImageGLTest.cpp

@ -324,8 +324,15 @@ void TextureImageGLTest::subImage2DArray() {
CORRADE_COMPARE(image.format(), pixelFormatWrap(GL::PixelFormat::RGBA)); CORRADE_COMPARE(image.format(), pixelFormatWrap(GL::PixelFormat::RGBA));
CORRADE_COMPARE(GL::PixelType(image.formatExtra()), GL::PixelType::UnsignedByte); CORRADE_COMPARE(GL::PixelType(image.formatExtra()), GL::PixelType::UnsignedByte);
CORRADE_COMPARE(image.pixelSize(), 4); CORRADE_COMPARE(image.pixelSize(), 4);
CORRADE_COMPARE_AS(Containers::arrayCast<UnsignedByte>(image.data()),
Containers::arrayView(Data2D), TestSuite::Compare::Container); {
#ifdef MAGNUM_TARGET_GLES
CORRADE_EXPECT_FAIL_IF(data.layer != 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_AS(Containers::arrayCast<UnsignedByte>(image.data()),
Containers::arrayView(Data2D), TestSuite::Compare::Container);
}
} }
void TextureImageGLTest::subImage2DArrayNotReadable() { void TextureImageGLTest::subImage2DArrayNotReadable() {
@ -558,9 +565,16 @@ void TextureImageGLTest::subImage2DFloat() {
CORRADE_COMPARE(image.format(), pixelFormatWrap(GL::PixelFormat::Red)); CORRADE_COMPARE(image.format(), pixelFormatWrap(GL::PixelFormat::Red));
CORRADE_COMPARE(GL::PixelType(image.formatExtra()), GL::PixelType::Float); CORRADE_COMPARE(GL::PixelType(image.formatExtra()), GL::PixelType::Float);
CORRADE_COMPARE(image.pixelSize(), 4); CORRADE_COMPARE(image.pixelSize(), 4);
CORRADE_COMPARE_AS(Containers::arrayCast<Float>(image.data()),
Containers::arrayView(Data2DFloat), {
TestSuite::Compare::Container); #ifdef MAGNUM_TARGET_GLES
CORRADE_EXPECT_FAIL_IF(data.level != 0 && GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader,
"SwiftShader is trash and doesn't implement texelFetch() from non-zero levels.");
#endif
CORRADE_COMPARE_AS(Containers::arrayCast<Float>(image.data()),
Containers::arrayView(Data2DFloat),
TestSuite::Compare::Container);
}
} }
void TextureImageGLTest::subImage2DFloatGeneric() { void TextureImageGLTest::subImage2DFloatGeneric() {
@ -582,9 +596,16 @@ void TextureImageGLTest::subImage2DFloatGeneric() {
CORRADE_COMPARE(image.format(), PixelFormat::R32F); CORRADE_COMPARE(image.format(), PixelFormat::R32F);
CORRADE_COMPARE(image.formatExtra(), 0); CORRADE_COMPARE(image.formatExtra(), 0);
CORRADE_COMPARE(image.pixelSize(), 4); CORRADE_COMPARE(image.pixelSize(), 4);
CORRADE_COMPARE_AS(Containers::arrayCast<Float>(image.data()),
Containers::arrayView(Data2DFloat), {
TestSuite::Compare::Container); #ifdef MAGNUM_TARGET_GLES
CORRADE_EXPECT_FAIL_IF(data.level != 0 && GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader,
"SwiftShader is trash and doesn't implement texelFetch() from non-zero levels.");
#endif
CORRADE_COMPARE_AS(Containers::arrayCast<Float>(image.data()),
Containers::arrayView(Data2DFloat),
TestSuite::Compare::Container);
}
} }
const Half Data2DHalf[] = { 1.0_h, const Half Data2DHalf[] = { 1.0_h,

21
src/Magnum/Text/Test/GlyphCacheGLTest.cpp

@ -650,12 +650,21 @@ void GlyphCacheGLTest::setImageArray() {
CORRADE_COMPARE_AS(image0, CORRADE_COMPARE_AS(image0,
(ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData03}), (ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData03}),
DebugTools::CompareImage); DebugTools::CompareImage);
CORRADE_COMPARE_AS(image1, {
(ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData1}), #ifdef MAGNUM_TARGET_GLES
DebugTools::CompareImage); CORRADE_EXPECT_FAIL_IF(GL::Context::current().detectedDriver() >= GL::Context::DetectedDriver::SwiftShader,
CORRADE_COMPARE_AS(image2, "SwiftShader is trash and doesn't implement reading from non-zero array layers.");
(ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData2}), #endif
DebugTools::CompareImage); CORRADE_COMPARE_AS(image1,
(ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData1}),
DebugTools::CompareImage);
CORRADE_COMPARE_AS(image2,
(ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData2}),
DebugTools::CompareImage);
}
/* This is broken on SwiftShader too, returning the first layer (or all
zeros) but since we expect the same as first layer (which is all zeros),
it passes */
CORRADE_COMPARE_AS(image3, CORRADE_COMPARE_AS(image3,
(ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData03}), (ImageView2D{PixelFormat::RG8Unorm, {8, 8}, expectedTextureData03}),
DebugTools::CompareImage); DebugTools::CompareImage);

Loading…
Cancel
Save