[Impeller] turned on validation errors for one golden image test (flutter/engine#49955)
issue https://github.com/flutter/flutter/issues/142017 This just turns on the validations for one test since not everything passes yet with them turned on across the board. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -60,6 +60,12 @@ static const std::vector<std::string> 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<std::string> 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<testing::MetalScreenshotter>();
|
||||
} else if (GetParam() == PlaygroundBackend::kVulkan) {
|
||||
pimpl_->screenshotter = std::make_unique<testing::VulkanScreenshotter>();
|
||||
pimpl_->screenshotter = std::make_unique<testing::VulkanScreenshotter>(
|
||||
enable_vulkan_validations);
|
||||
}
|
||||
|
||||
std::string test_name = GetTestName();
|
||||
if (std::find(kSkipTests.begin(), kSkipTests.end(), test_name) !=
|
||||
kSkipTests.end()) {
|
||||
GTEST_SKIP_(
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace testing {
|
||||
/// playground backend.
|
||||
class VulkanScreenshotter : public Screenshotter {
|
||||
public:
|
||||
VulkanScreenshotter();
|
||||
explicit VulkanScreenshotter(bool enable_validations);
|
||||
|
||||
std::unique_ptr<Screenshot> MakeScreenshot(
|
||||
AiksContext& aiks_context,
|
||||
|
||||
@@ -64,10 +64,12 @@ std::unique_ptr<Screenshot> ReadTexture(
|
||||
}
|
||||
} // namespace
|
||||
|
||||
VulkanScreenshotter::VulkanScreenshotter() {
|
||||
VulkanScreenshotter::VulkanScreenshotter(bool enable_validations) {
|
||||
FML_CHECK(::glfwInit() == GLFW_TRUE);
|
||||
PlaygroundSwitches playground_switches;
|
||||
playground_switches.enable_vulkan_validation = enable_validations;
|
||||
playground_ =
|
||||
PlaygroundImpl::Create(PlaygroundBackend::kVulkan, PlaygroundSwitches{});
|
||||
PlaygroundImpl::Create(PlaygroundBackend::kVulkan, playground_switches);
|
||||
}
|
||||
|
||||
std::unique_ptr<Screenshot> VulkanScreenshotter::MakeScreenshot(
|
||||
|
||||
Reference in New Issue
Block a user