From f92e16e7e04e6eb2b66804b0072f8490bf4df753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 31 Mar 2025 20:37:44 +0200 Subject: [PATCH] Shaders: use `.slice(&Color4ub::rgb)` instead of `arrayCast()`. Less error-prone because of full type safety and much nicer overall. The test code originates from a time before slice-to-a-member-function was a thing and then it got just copied everywhere without much thought. --- src/Magnum/GL/Test/RendererGLTest.cpp | 2 +- .../Test/DistanceFieldVectorGLTest.cpp | 14 ++--- src/Magnum/Shaders/Test/FlatGLTest.cpp | 48 +++++++------- src/Magnum/Shaders/Test/LineGLTest.cpp | 26 ++++---- .../Shaders/Test/MeshVisualizerGLTest.cpp | 62 +++++++++---------- src/Magnum/Shaders/Test/PhongGLTest.cpp | 46 +++++++------- src/Magnum/Shaders/Test/VectorGLTest.cpp | 12 ++-- src/Magnum/Shaders/Test/VertexColorGLTest.cpp | 12 ++-- 8 files changed, 111 insertions(+), 111 deletions(-) diff --git a/src/Magnum/GL/Test/RendererGLTest.cpp b/src/Magnum/GL/Test/RendererGLTest.cpp index ba54fed67..19741630e 100644 --- a/src/Magnum/GL/Test/RendererGLTest.cpp +++ b/src/Magnum/GL/Test/RendererGLTest.cpp @@ -246,7 +246,7 @@ void RendererGLTest::pointCoord() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {Magnum::PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {Magnum::PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "pointcoord.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } diff --git a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp index 1003bffb3..f4c8112c9 100644 --- a/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/DistanceFieldVectorGLTest.cpp @@ -1022,7 +1022,7 @@ template void DistanceFieldVectorGLTest::ren sharp default shininess it can't be exact */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "VectorTestFiles/defaults.tga"), (DebugTools::CompareImageToFile{_manager, 131.0f, 1.83f})); @@ -1036,7 +1036,7 @@ template void DistanceFieldVectorGLTest::ren #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "VectorTestFiles/defaults-distancefield.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -1132,7 +1132,7 @@ template void DistanceFieldVectorGLTest::ren sharp default shininess it can't be exact */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "VectorTestFiles/defaults.tga"), (DebugTools::CompareImageToFile{_manager, 131.0f, 1.83f})); @@ -1146,7 +1146,7 @@ template void DistanceFieldVectorGLTest::ren #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "VectorTestFiles/defaults-distancefield.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -1320,7 +1320,7 @@ template void DistanceFieldVectorGLTest::ren Image2D rendered = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); /* Dropping the alpha channel, as it's always 1.0 */ Containers::StridedArrayView2D pixels = - Containers::arrayCast(rendered.pixels()); + rendered.pixels().slice(&Color4ub::rgb); if(data.flip) pixels = pixels.flipped<0>().flipped<1>(); #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) @@ -1819,7 +1819,7 @@ void DistanceFieldVectorGLTest::renderMulti2D() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "VectorTestFiles", data.expected2D}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); } @@ -2124,7 +2124,7 @@ void DistanceFieldVectorGLTest::renderMulti3D() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "VectorTestFiles", data.expected3D}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); } diff --git a/src/Magnum/Shaders/Test/FlatGLTest.cpp b/src/Magnum/Shaders/Test/FlatGLTest.cpp index 66609aee0..8707aec52 100644 --- a/src/Magnum/Shaders/Test/FlatGLTest.cpp +++ b/src/Magnum/Shaders/Test/FlatGLTest.cpp @@ -1889,7 +1889,7 @@ template void FlatGLTest::renderDefaults2D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/defaults.tga"), /* SwiftShader has 8 different pixels on the edges */ (DebugTools::CompareImageToFile{_manager, 238.0f, 0.2975f})); @@ -1965,7 +1965,7 @@ template void FlatGLTest::renderDefaults3D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/defaults.tga"), /* SwiftShader has 8 different pixels on the edges */ (DebugTools::CompareImageToFile{_manager, 238.0f, 0.2975f})); @@ -2052,7 +2052,7 @@ template void FlatGLTest::renderColored2D() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/colored2D.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -2148,7 +2148,7 @@ template void FlatGLTest::renderColored3D() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/colored3D.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -2298,7 +2298,7 @@ template void FlatGLTest::renderSinglePixelTextured2D() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/colored2D.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -2443,7 +2443,7 @@ template void FlatGLTest::renderSinglePixelTextured3D() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/colored3D.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -2582,7 +2582,7 @@ template void FlatGLTest::renderTextured2D() { Image2D rendered = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); /* Dropping the alpha channel, as it's always 1.0 */ Containers::StridedArrayView2D pixels = - Containers::arrayCast(rendered.pixels()); + rendered.pixels().slice(&Color4ub::rgb); if(data.flip) pixels = pixels.flipped<0>().flipped<1>(); #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) @@ -2741,7 +2741,7 @@ template void FlatGLTest::renderTextured3D() { Image2D rendered = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); /* Dropping the alpha channel, as it's always 1.0 */ Containers::StridedArrayView2D pixels = - Containers::arrayCast(rendered.pixels()); + rendered.pixels().slice(&Color4ub::rgb); if(data.flip) pixels = pixels.flipped<0>().flipped<1>(); #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) @@ -2863,7 +2863,7 @@ template void FlatGLTest::renderVertexColor2D() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/vertexColor2D.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -2984,7 +2984,7 @@ template void FlatGLTest::renderVertexColor3D() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/vertexColor3D.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -3107,7 +3107,7 @@ template void FlatGLTest::renderAlpha2D() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, data.expected2D), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -3237,7 +3237,7 @@ template void FlatGLTest::renderAlpha3D() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, data.expected3D}), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -3387,7 +3387,7 @@ template void FlatGLTest::renderObjectId2D() { const Float maxThreshold = 0.0f, meanThreshold = 0.0f; CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/colored2D.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); @@ -3569,7 +3569,7 @@ template void FlatGLTest::renderObjectId3D() { CORRADE_COMPARE(_framebuffer.checkStatus(GL::FramebufferTarget::Read), GL::Framebuffer::Status::Complete); CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/colored3D.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); @@ -3743,7 +3743,7 @@ template void FlatGLTest::renderSkinning2D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "TestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager})); } @@ -3896,7 +3896,7 @@ template void FlatGLTest::renderSkinning3D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "TestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager})); } @@ -4222,7 +4222,7 @@ template void FlatGLTest::renderInstanced2D() { */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "FlatTestFiles", data.expected2D}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); @@ -4573,7 +4573,7 @@ template void FlatGLTest::renderInstanced3D() { */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "FlatTestFiles", data.expected3D}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); @@ -4741,7 +4741,7 @@ template void FlatGLTest::renderInstancedSkinning2D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "TestFiles/skinning-instanced.tga"), (DebugTools::CompareImageToFile{_manager})); } @@ -4890,7 +4890,7 @@ template void FlatGLTest::renderInstancedSkinning3D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "TestFiles/skinning-instanced.tga"), (DebugTools::CompareImageToFile{_manager})); } @@ -5242,7 +5242,7 @@ void FlatGLTest::renderMulti2D() { */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "FlatTestFiles", data.expected2D}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); @@ -5614,7 +5614,7 @@ void FlatGLTest::renderMulti3D() { */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "FlatTestFiles", data.expected3D}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); @@ -5881,7 +5881,7 @@ void FlatGLTest::renderMultiSkinning2D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "TestFiles/skinning-multi.tga"), (DebugTools::CompareImageToFile{_manager})); } @@ -6133,7 +6133,7 @@ void FlatGLTest::renderMultiSkinning3D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "TestFiles/skinning-multi.tga"), (DebugTools::CompareImageToFile{_manager})); } diff --git a/src/Magnum/Shaders/Test/LineGLTest.cpp b/src/Magnum/Shaders/Test/LineGLTest.cpp index d1ca96059..534b2c484 100644 --- a/src/Magnum/Shaders/Test/LineGLTest.cpp +++ b/src/Magnum/Shaders/Test/LineGLTest.cpp @@ -1257,7 +1257,7 @@ template void LineGLTest::renderDefaults2D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(SHADERS_TEST_DIR, "LineTestFiles/defaults.tga"), (DebugTools::CompareImageToFile{_manager})); } @@ -1355,7 +1355,7 @@ template void LineGLTest::renderDefaults3D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(SHADERS_TEST_DIR, "LineTestFiles/defaults.tga"), (DebugTools::CompareImageToFile{_manager})); } @@ -1514,7 +1514,7 @@ template void LineGLTest::renderLineCapsJoins2D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(image.pixels()), + image.pixels().slice(&Color4ub::rgb), Utility::Path::join({SHADERS_TEST_DIR, "LineTestFiles", data.expected}), /* Minor differences on NVidia vs Mesa Intel vs SwiftShader */ (DebugTools::CompareImageToFile{_manager, 119.0f, 0.111f})); @@ -1578,7 +1578,7 @@ void LineGLTest::renderLineCapsJoins2DReversed() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({SHADERS_TEST_DIR, "LineTestFiles", data.expected}), /* Minor differences on NVidia vs Mesa Intel vs SwiftShader */ /** @todo sync this with render2D() once the overlaps are fixed */ @@ -1638,7 +1638,7 @@ void LineGLTest::renderLineCapsJoins2DTransformed() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({SHADERS_TEST_DIR, "LineTestFiles", data.expected}), /* Minor differences on NVidia vs Mesa Intel vs SwiftShader */ (DebugTools::CompareImageToFile{_manager, 119.0f, 0.112f})); @@ -1841,7 +1841,7 @@ template void LineGLTest::renderCube3D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({SHADERS_TEST_DIR, "LineTestFiles", data.expected}), /* Minor differences on NVidia vs Mesa Intel vs SwiftShader */ (DebugTools::CompareImageToFile{_manager, 119.0f, 0.102f})); @@ -1876,7 +1876,7 @@ void LineGLTest::renderPerspective3D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(SHADERS_TEST_DIR, "LineTestFiles/perspective3D.tga"), /* Minor differences on SwiftShader */ (DebugTools::CompareImageToFile{_manager, 6.0f, 0.025f})); @@ -1987,7 +1987,7 @@ template void LineGLTest::renderVertexColor2D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(SHADERS_TEST_DIR, "LineTestFiles/vertex-color.tga"), /* Minor differences on NVidia vs Mesa Intel vs SwiftShader */ (DebugTools::CompareImageToFile{_manager, 1.34f, 0.028f})); @@ -2101,7 +2101,7 @@ template void LineGLTest::renderVertexColor3D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(SHADERS_TEST_DIR, "LineTestFiles/vertex-color.tga"), /* Minor differences on NVidia vs Mesa Intel vs SwiftShader */ (DebugTools::CompareImageToFile{_manager, 1.34f, 0.028f})); @@ -2455,7 +2455,7 @@ template void LineGLTest::renderInstanced2D() { - Third up center, magenta with a yellow base color, so red */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(SHADERS_TEST_DIR, "LineTestFiles/instanced.tga"), /* Minor differences on NVidia vs Mesa Intel vs SwiftShader */ (DebugTools::CompareImageToFile{_manager, 17.0f, 0.107f})); @@ -2611,7 +2611,7 @@ template void LineGLTest::renderInstanced3D() { - Third up center, magenta with a yellow base color, so red */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(SHADERS_TEST_DIR, "LineTestFiles/instanced.tga"), /* Minor differences on NVidia vs Mesa Intel vs SwiftShader */ (DebugTools::CompareImageToFile{_manager, 17.0f, 0.107f})); @@ -2845,7 +2845,7 @@ void LineGLTest::renderMulti2D() { - Point up center, red */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(SHADERS_TEST_DIR, "LineTestFiles/multidraw.tga"), /* Minor differences on NVidia vs Mesa Intel, also on ARM Mali */ (DebugTools::CompareImageToFile{_manager, 0.67f, 0.011f})); @@ -3076,7 +3076,7 @@ void LineGLTest::renderMulti3D() { - Point up center, red */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(SHADERS_TEST_DIR, "LineTestFiles/multidraw.tga"), /* Minor differences on NVidia vs Mesa Intel, also on ARM Mali */ (DebugTools::CompareImageToFile{_manager, 0.67f, 0.011f})); diff --git a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp index e4c98458b..a58a48f6d 100644 --- a/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp +++ b/src/Magnum/Shaders/Test/MeshVisualizerGLTest.cpp @@ -3266,7 +3266,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_EXPECT_FAIL("Defaults don't work for wireframe as line width is derived from viewport size."); CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-wireframe2D.tga"), (DebugTools::CompareImageToFile{_manager})); } @@ -3302,7 +3302,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-wireframe2D.tga"), /* AMD has off-by-one errors on edges compared to Intel */ (DebugTools::CompareImageToFile{_manager, 1.0f, 0.082f})); @@ -3388,7 +3388,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_EXPECT_FAIL("Defaults don't work for wireframe as line width is derived from viewport size."); CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-wireframe3D.tga"), (DebugTools::CompareImageToFile{_manager})); } @@ -3428,7 +3428,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-wireframe3D.tga"), /* AMD has off-by-one errors on edges compared to Intel */ (DebugTools::CompareImageToFile{_manager, 1.0f, 0.06f})); @@ -3506,7 +3506,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-objectid2D.tga"), /* SwiftShader has a few rounding errors on edges */ (DebugTools::CompareImageToFile{_manager, 24.67f, 0.11f})); @@ -3586,7 +3586,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-objectid3D.tga"), /* SwiftShader has a few rounding errors on edges and off-by-two pixels */ @@ -3686,7 +3686,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-instancedobjectid2D.tga"), /* SwiftShader has a few rounding errors on edges */ (DebugTools::CompareImageToFile{_manager, 150.67f, 0.45f})); @@ -3789,7 +3789,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-instancedobjectid3D.tga"), /* SwiftShader has a few rounding errors on edges */ (DebugTools::CompareImageToFile{_manager, 150.67f, 0.165f})); @@ -3864,7 +3864,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-vertexid2D.tga"), /* Minor differences on NVidia */ (DebugTools::CompareImageToFile{_manager, 1.0f, 0.022f})); @@ -3943,7 +3943,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-vertexid3D.tga"), /* Minor differences on NVidia */ (DebugTools::CompareImageToFile{_manager, 1.0f, 0.018f})); @@ -4047,7 +4047,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-primitiveid2D.tga"), /* SwiftShader has a few rounding errors on edges */ (DebugTools::CompareImageToFile{_manager, 76.67f, 0.23f})); @@ -4155,7 +4155,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-primitiveid3D.tga"), /* SwiftShader has a few rounding errors on edges */ (DebugTools::CompareImageToFile{_manager, 88.34f, 0.071f})); @@ -4237,7 +4237,7 @@ template void MeshVisualizerGLTest::renderDefault CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/defaults-tbn.tga"), /* AMD has off-by-one errors on edges compared to Intel */ (DebugTools::CompareImageToFile{_manager, 1.0f, 0.06f})); @@ -4376,7 +4376,7 @@ template void MeshVisualizerGLTest::renderWirefra #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.file}), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -4393,7 +4393,7 @@ template void MeshVisualizerGLTest::renderWirefra #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.fileXfail}), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -4547,7 +4547,7 @@ template void MeshVisualizerGLTest::renderWirefra #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.file}), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -4564,7 +4564,7 @@ template void MeshVisualizerGLTest::renderWirefra #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.fileXfail}), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -4780,7 +4780,7 @@ template void MeshVisualizerGLTest::renderObjectV CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.file2D}), /* AMD has slight off-by-one errors compared to Intel, SwiftShader a bit more */ @@ -5015,7 +5015,7 @@ template void MeshVisualizerGLTest::renderObjectV #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.file3D}), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -5059,7 +5059,7 @@ void MeshVisualizerGLTest::renderWireframe3DPerspective() { /* Slight rasterization differences on AMD. */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/wireframe-perspective.tga"), (DebugTools::CompareImageToFile{_manager, 0.667f, 0.002f})); } @@ -5270,7 +5270,7 @@ template void MeshVisualizerGLTest::renderTangent #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.file}), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -5433,7 +5433,7 @@ template void MeshVisualizerGLTest::renderSkinnin CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.expected}), /* Minor differences on ARM Mali */ (DebugTools::CompareImageToFile{_manager, 1.0f, 0.012f})); @@ -5599,7 +5599,7 @@ template void MeshVisualizerGLTest::renderSkinnin CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.expected}), /* Minor differences on ARM Mali */ (DebugTools::CompareImageToFile{_manager, 1.0f, 0.012f})); @@ -5899,7 +5899,7 @@ template void MeshVisualizerGLTest::renderInstanc */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); } @@ -6226,7 +6226,7 @@ template void MeshVisualizerGLTest::renderInstanc */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); } @@ -6384,7 +6384,7 @@ template void MeshVisualizerGLTest::renderInstanc CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/skinning-instanced.tga"), /* SwiftShader has minor differences in the output, ARM Mali too, NVidia as well */ @@ -6546,7 +6546,7 @@ template void MeshVisualizerGLTest::renderInstanc CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/skinning-instanced.tga"), /* SwiftShader has minor differences in the output, ARM Mali too, NVidia as well */ @@ -6890,7 +6890,7 @@ void MeshVisualizerGLTest::renderMulti2D() { */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); } @@ -7241,7 +7241,7 @@ void MeshVisualizerGLTest::renderMulti3D() { */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "MeshVisualizerTestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); } @@ -7492,7 +7492,7 @@ void MeshVisualizerGLTest::renderMultiSkinningWireframe2D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/skinning-multi.tga"), (DebugTools::CompareImageToFile{_manager})); } @@ -7745,7 +7745,7 @@ void MeshVisualizerGLTest::renderMultiSkinningWireframe3D() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "MeshVisualizerTestFiles/skinning-multi.tga"), (DebugTools::CompareImageToFile{_manager})); } diff --git a/src/Magnum/Shaders/Test/PhongGLTest.cpp b/src/Magnum/Shaders/Test/PhongGLTest.cpp index c2416ce3f..c3a48d1a2 100644 --- a/src/Magnum/Shaders/Test/PhongGLTest.cpp +++ b/src/Magnum/Shaders/Test/PhongGLTest.cpp @@ -2386,7 +2386,7 @@ template void PhongGLTest::renderDefaults() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "PhongTestFiles/defaults.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -2527,7 +2527,7 @@ template void PhongGLTest::renderColored() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "PhongTestFiles/colored.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -2750,7 +2750,7 @@ template void PhongGLTest::renderSinglePixelTextured() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "PhongTestFiles/colored.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -3013,7 +3013,7 @@ template void PhongGLTest::renderTextured() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "PhongTestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -3213,7 +3213,7 @@ template void PhongGLTest::renderTexturedNormal() { Image2D actual = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); Containers::StridedArrayView2D pixels = /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(actual.pixels()); + actual.pixels().slice(&Color4ub::rgb); /* Rotate pixels back to upright position so we can compare with the 0° file and ensure the tangent calculation is transformation invariant */ @@ -3384,7 +3384,7 @@ template void PhongGLTest::renderVertexColor() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "PhongTestFiles/vertexColor.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -3521,7 +3521,7 @@ template void PhongGLTest::renderShininess() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "PhongTestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -3543,7 +3543,7 @@ template void PhongGLTest::renderShininess() { ) { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "PhongTestFiles", "shininess0-overflow.tga"}), /* The threshold = 0.001 case has a slight reddish tone on SwiftShader; ARM Mali has one pixel off */ @@ -3735,7 +3735,7 @@ template void PhongGLTest::renderAlpha() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, data.expected), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -3914,7 +3914,7 @@ template void PhongGLTest::renderObjectId() { const Float maxThreshold = 12.67f, meanThreshold = 0.113f; CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "PhongTestFiles/colored.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); @@ -4053,7 +4053,7 @@ template void PhongGLTest::renderLights() { MAGNUM_VERIFY_NO_GL_ERROR(); - const Image2D image = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); + Image2D image = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); /* Analytical output check. Comment this out when image comparison fails for easier debugging. */ @@ -4070,7 +4070,7 @@ template void PhongGLTest::renderLights() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(image.pixels()), + image.pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "PhongTestFiles", data.file}), /* Minor differences on ES2 and on NVidia */ (DebugTools::CompareImageToFile{_manager, 3.0f, 0.27f})); @@ -4117,7 +4117,7 @@ void PhongGLTest::renderLightsSetOneByOne() { } #endif - const Image2D image = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); + Image2D image = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); if(!(_manager.loadState("AnyImageImporter") & PluginManager::LoadState::Loaded) || !(_manager.loadState("TgaImporter") & PluginManager::LoadState::Loaded)) @@ -4131,7 +4131,7 @@ void PhongGLTest::renderLightsSetOneByOne() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(image.pixels()), + image.pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "PhongTestFiles/light-point-range1.5.tga"}), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -4174,7 +4174,7 @@ void PhongGLTest::renderLowLightAngle() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "PhongTestFiles/low-light-angle.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -4266,7 +4266,7 @@ void PhongGLTest::renderLightCulling() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "PhongTestFiles/colored.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -4452,7 +4452,7 @@ template void PhongGLTest::renderZeroLights() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), /* Should be equivalent to masked Flat3D */ Utility::Path::join(_testDir, "FlatTestFiles/textured3D-alpha-mask0.5.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); @@ -4552,7 +4552,7 @@ void PhongGLTest::renderDoubleSided() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "PhongTestFiles/double-sided.tga"), (DebugTools::CompareImageToFile{_manager, 1.34f, 0.04f})); } @@ -4715,7 +4715,7 @@ template void PhongGLTest::renderSkinning() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "TestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager})); } @@ -5143,7 +5143,7 @@ template void PhongGLTest::renderInstanced() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "PhongTestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); @@ -5317,7 +5317,7 @@ template void PhongGLTest::renderInstancedSkinning() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "TestFiles/skinning-instanced.tga"), (DebugTools::CompareImageToFile{_manager})); } @@ -5724,7 +5724,7 @@ void PhongGLTest::renderMulti() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "PhongTestFiles", data.expected}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); @@ -5995,7 +5995,7 @@ void PhongGLTest::renderMultiSkinning() { CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "TestFiles/skinning-multi.tga"), (DebugTools::CompareImageToFile{_manager})); } diff --git a/src/Magnum/Shaders/Test/VectorGLTest.cpp b/src/Magnum/Shaders/Test/VectorGLTest.cpp index bf7c6ef1f..9e5b18f24 100644 --- a/src/Magnum/Shaders/Test/VectorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VectorGLTest.cpp @@ -1015,7 +1015,7 @@ template void VectorGLTest::renderDefaults2D() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "VectorTestFiles/defaults.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -1117,7 +1117,7 @@ template void VectorGLTest::renderDefaults3D() { #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "VectorTestFiles/defaults.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -1291,7 +1291,7 @@ template void VectorGLTest::render2D() { Image2D rendered = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); /* Dropping the alpha channel, as it's always 1.0 */ Containers::StridedArrayView2D pixels = - Containers::arrayCast(rendered.pixels()); + rendered.pixels().slice(&Color4ub::rgb); if(data.flip) pixels = pixels.flipped<0>().flipped<1>(); #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) @@ -1477,7 +1477,7 @@ template void VectorGLTest::render3D() { Image2D rendered = _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}); /* Dropping the alpha channel, as it's always 1.0 */ Containers::StridedArrayView2D pixels = - Containers::arrayCast(rendered.pixels()); + rendered.pixels().slice(&Color4ub::rgb); if(data.flip) pixels = pixels.flipped<0>().flipped<1>(); #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) @@ -1784,7 +1784,7 @@ void VectorGLTest::renderMulti2D() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "VectorTestFiles", data.expected2D}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); } @@ -2089,7 +2089,7 @@ void VectorGLTest::renderMulti3D() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "VectorTestFiles", data.expected3D}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); } diff --git a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp index e930df2c7..9ef975d6b 100644 --- a/src/Magnum/Shaders/Test/VertexColorGLTest.cpp +++ b/src/Magnum/Shaders/Test/VertexColorGLTest.cpp @@ -712,7 +712,7 @@ template void VertexColorGLTest::renderDefa #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/defaults.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -797,7 +797,7 @@ template void VertexColorGLTest::renderDefa #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "FlatTestFiles/defaults.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -887,7 +887,7 @@ template void VertexColorGLTest::render2D() #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "VertexColorTestFiles/vertexColor2D.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -986,7 +986,7 @@ template void VertexColorGLTest::render3D() #endif CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join(_testDir, "VertexColorTestFiles/vertexColor3D.tga"), (DebugTools::CompareImageToFile{_manager, maxThreshold, meanThreshold})); } @@ -1133,7 +1133,7 @@ void VertexColorGLTest::renderMulti2D() { */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "VertexColorTestFiles", data.expected2D}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); } @@ -1282,7 +1282,7 @@ void VertexColorGLTest::renderMulti3D() { */ CORRADE_COMPARE_WITH( /* Dropping the alpha channel, as it's always 1.0 */ - Containers::arrayCast(_framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels()), + _framebuffer.read(_framebuffer.viewport(), {PixelFormat::RGBA8Unorm}).pixels().slice(&Color4ub::rgb), Utility::Path::join({_testDir, "VertexColorTestFiles", data.expected3D}), (DebugTools::CompareImageToFile{_manager, data.maxThreshold, data.meanThreshold})); }