From 3a25fd1a2c15852c8088e105349b52ce14165fa6 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Mon, 22 Jan 2024 16:17:09 -0800 Subject: [PATCH 1/3] [Impeller] turned on validation errors for the golden image tests --- impeller/golden_tests/vulkan_screenshotter.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/impeller/golden_tests/vulkan_screenshotter.mm b/impeller/golden_tests/vulkan_screenshotter.mm index 5633faf832bbb..64952ff015b20 100644 --- a/impeller/golden_tests/vulkan_screenshotter.mm +++ b/impeller/golden_tests/vulkan_screenshotter.mm @@ -66,8 +66,10 @@ VulkanScreenshotter::VulkanScreenshotter() { FML_CHECK(::glfwInit() == GLFW_TRUE); + PlaygroundSwitches playground_switches; + playground_switches.enable_vulkan_validation = true; playground_ = - PlaygroundImpl::Create(PlaygroundBackend::kVulkan, PlaygroundSwitches{}); + PlaygroundImpl::Create(PlaygroundBackend::kVulkan, playground_switches); } std::unique_ptr VulkanScreenshotter::MakeScreenshot( From a67f8069f0fa303284ffa3c26a321240ddd567a1 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 23 Jan 2024 09:09:58 -0800 Subject: [PATCH 2/3] turned into allow list for now --- .../golden_tests/golden_playground_test_mac.cc | 17 +++++++++++++++-- impeller/golden_tests/vulkan_screenshotter.h | 2 +- impeller/golden_tests/vulkan_screenshotter.mm | 4 ++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/impeller/golden_tests/golden_playground_test_mac.cc b/impeller/golden_tests/golden_playground_test_mac.cc index a465a33e7627b..c8bbe289d60e0 100644 --- a/impeller/golden_tests/golden_playground_test_mac.cc +++ b/impeller/golden_tests/golden_playground_test_mac.cc @@ -60,6 +60,12 @@ static const std::vector kSkipTests = { "impeller_Play_AiksTest_CaptureContext_Vulkan", }; +/// TODO(https://github.com/flutter/flutter/issues/142017): Turn on validation +/// for all vulkan tests. +static const std::vector kVulkanValidationTests = { + "impeller_Play_AiksTest_CanRenderTextFrame_Vulkan", +}; + namespace { std::string GetTestName() { std::string suite_name = @@ -127,13 +133,20 @@ void GoldenPlaygroundTest::SetUp() { return; } + bool enable_vulkan_validations = false; + std::string test_name = GetTestName(); + if (std::find(kVulkanValidationTests.begin(), kVulkanValidationTests.end(), + test_name) != kVulkanValidationTests.end()) { + enable_vulkan_validations = true; + } + if (GetParam() == PlaygroundBackend::kMetal) { pimpl_->screenshotter = std::make_unique(); } else if (GetParam() == PlaygroundBackend::kVulkan) { - pimpl_->screenshotter = std::make_unique(); + pimpl_->screenshotter = std::make_unique( + enable_vulkan_validations); } - std::string test_name = GetTestName(); if (std::find(kSkipTests.begin(), kSkipTests.end(), test_name) != kSkipTests.end()) { GTEST_SKIP_( diff --git a/impeller/golden_tests/vulkan_screenshotter.h b/impeller/golden_tests/vulkan_screenshotter.h index 78d8e639f9853..32b6428007524 100644 --- a/impeller/golden_tests/vulkan_screenshotter.h +++ b/impeller/golden_tests/vulkan_screenshotter.h @@ -18,7 +18,7 @@ namespace testing { /// playground backend. class VulkanScreenshotter : public Screenshotter { public: - VulkanScreenshotter(); + VulkanScreenshotter(bool enable_validations); std::unique_ptr MakeScreenshot( AiksContext& aiks_context, diff --git a/impeller/golden_tests/vulkan_screenshotter.mm b/impeller/golden_tests/vulkan_screenshotter.mm index 64952ff015b20..1daaee4cd8929 100644 --- a/impeller/golden_tests/vulkan_screenshotter.mm +++ b/impeller/golden_tests/vulkan_screenshotter.mm @@ -64,10 +64,10 @@ } } // namespace -VulkanScreenshotter::VulkanScreenshotter() { +VulkanScreenshotter::VulkanScreenshotter(bool enable_validations) { FML_CHECK(::glfwInit() == GLFW_TRUE); PlaygroundSwitches playground_switches; - playground_switches.enable_vulkan_validation = true; + playground_switches.enable_vulkan_validation = enable_validations; playground_ = PlaygroundImpl::Create(PlaygroundBackend::kVulkan, playground_switches); } From 5c3d12aaec7c31d86d2b820699f9c42a8cce9cb4 Mon Sep 17 00:00:00 2001 From: Aaron Clarke Date: Tue, 23 Jan 2024 09:37:58 -0800 Subject: [PATCH 3/3] tidy --- impeller/golden_tests/vulkan_screenshotter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/golden_tests/vulkan_screenshotter.h b/impeller/golden_tests/vulkan_screenshotter.h index 32b6428007524..b48ad61df9cf4 100644 --- a/impeller/golden_tests/vulkan_screenshotter.h +++ b/impeller/golden_tests/vulkan_screenshotter.h @@ -18,7 +18,7 @@ namespace testing { /// playground backend. class VulkanScreenshotter : public Screenshotter { public: - VulkanScreenshotter(bool enable_validations); + explicit VulkanScreenshotter(bool enable_validations); std::unique_ptr MakeScreenshot( AiksContext& aiks_context,