From 3dd58581dc47fe9e732f9034fac9b83efdfca838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 27 Sep 2022 20:42:38 +0200 Subject: [PATCH] Vk: add conditional XFAILs for tests that assume an Intel GPU. Err... a tightly-packed memory layout like on an Intel GPU. Funny that SwiftShader follows that but llvmpipe (which is also Mesa!) not. --- src/Magnum/Vk/Test/ImageVkTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Magnum/Vk/Test/ImageVkTest.cpp b/src/Magnum/Vk/Test/ImageVkTest.cpp index 5a79ee16d..195f962fe 100644 --- a/src/Magnum/Vk/Test/ImageVkTest.cpp +++ b/src/Magnum/Vk/Test/ImageVkTest.cpp @@ -375,6 +375,8 @@ void ImageVkTest::cmdClearColorImageFloat() { .end(); queue().submit({SubmitInfo{}.setCommandBuffers({cmd})}).wait(); + CORRADE_EXPECT_FAIL_IF(a.dedicatedMemory().size() != 4*4*4 && !device().properties().name().hasPrefix("SwiftShader"), + "The image doesn't have a tightly-packed memory, the following check won't work."); CORRADE_COMPARE_AS(Containers::arrayCast(a.dedicatedMemory().mapRead().prefix(4*4*4)), Containers::arrayView({ 0xdeadc0de_rgba, 0xdeadc0de_rgba, 0xdeadc0de_rgba, 0xdeadc0de_rgba, 0xdeadc0de_rgba, 0xdeadc0de_rgba, 0xdeadc0de_rgba, 0xdeadc0de_rgba, @@ -413,6 +415,8 @@ void ImageVkTest::cmdClearColorImageSignedIntegral() { .end(); queue().submit({SubmitInfo{}.setCommandBuffers({cmd})}).wait(); + CORRADE_EXPECT_FAIL_IF(a.dedicatedMemory().size() != 4*4*4 && !device().properties().name().hasPrefix("SwiftShader"), + "The image doesn't have a tightly-packed memory, the following check won't work."); CORRADE_COMPARE_AS(Containers::arrayCast(a.dedicatedMemory().mapRead().prefix(4*4*4)), Containers::arrayView({ {15, -7, 2, -1}, {15, -7, 2, -1}, {15, -7, 2, -1}, {15, -7, 2, -1}, {15, -7, 2, -1}, {15, -7, 2, -1}, {15, -7, 2, -1}, {15, -7, 2, -1}, @@ -451,6 +455,8 @@ void ImageVkTest::cmdClearColorImageUnsignedIntegral() { .end(); queue().submit({SubmitInfo{}.setCommandBuffers({cmd})}).wait(); + CORRADE_EXPECT_FAIL_IF(a.dedicatedMemory().size() != 4*4*4 && !device().properties().name().hasPrefix("SwiftShader"), + "The image doesn't have a tightly-packed memory, the following check won't work."); CORRADE_COMPARE_AS(Containers::arrayCast(a.dedicatedMemory().mapRead().prefix(4*4*4)), Containers::arrayView({ {15, 37, 2, 1}, {15, 37, 2, 1}, {15, 37, 2, 1}, {15, 37, 2, 1}, {15, 37, 2, 1}, {15, 37, 2, 1}, {15, 37, 2, 1}, {15, 37, 2, 1}, @@ -666,6 +672,8 @@ void ImageVkTest::cmdCopyImage2D() { .end(); queue().submit({SubmitInfo{}.setCommandBuffers({cmd})}).wait(); + CORRADE_EXPECT_FAIL_IF(b.dedicatedMemory().size() != 8*5*4 && !device().properties().name().hasPrefix("SwiftShader"), + "The image doesn't have a tightly-packed memory, the following check won't work."); CORRADE_COMPARE(b.dedicatedMemory().mapRead().prefix(8*5*4), "--------------------------------" "----AaaaAaaaAaaaAaaa------------"