| Flutter Impeller |

driver_info_vk_unittests.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "impeller/playground/playground_test.h"
6 #include "impeller/renderer/backend/vulkan/context_vk.h"
7 #include "impeller/renderer/backend/vulkan/surface_context_vk.h"
8
9 namespace impeller::testing {
10
11 using DriverInfoVKTest = PlaygroundTest;
12 INSTANTIATE_VULKAN_PLAYGROUND_SUITE(DriverInfoVKTest);
13
14 TEST_P(DriverInfoVKTest, CanQueryDriverInfo) {
15 ASSERT_TRUE(GetContext());
16 const auto& driver_info =
17 SurfaceContextVK::Cast(*GetContext()).GetParent()->GetDriverInfo();
18 ASSERT_NE(driver_info, nullptr);
19 // 1.1 is the base Impeller version. The driver can't be lower than that.
20 ASSERT_TRUE(driver_info->GetAPIVersion().IsAtLeast(Version{1, 1, 0}));
21 ASSERT_NE(driver_info->GetVendor(), VendorVK::kUnknown);
22 ASSERT_NE(driver_info->GetDeviceType(), DeviceTypeVK::kUnknown);
23 ASSERT_NE(driver_info->GetDriverName(), "");
24 }
25
26 TEST_P(DriverInfoVKTest, CanDumpToLog) {
27 ASSERT_TRUE(GetContext());
28 const auto& driver_info =
29 SurfaceContextVK::Cast(*GetContext()).GetParent()->GetDriverInfo();
30 ASSERT_NE(driver_info, nullptr);
31 fml::testing::LogCapture log;
32 driver_info->DumpToLog();
33 ASSERT_TRUE(log.str().find("Driver Information") != std::string::npos);
34 }
35
36 } // namespace impeller::testing
impeller::SurfaceContextVK::GetParent
const std::shared_ptr< ContextVK > & GetParent() const
Definition: surface_context_vk.cc:106
surface_context_vk.h
impeller::Version
Definition: version.h:16
impeller::testing::TEST_P
TEST_P(AiksTest, CanRenderAdvancedBlendColorFilterWithSaveLayer)
Definition: aiks_blend_unittests.cc:21
impeller::testing
Definition: aiks_blend_unittests.cc:19
impeller::testing::INSTANTIATE_VULKAN_PLAYGROUND_SUITE
INSTANTIATE_VULKAN_PLAYGROUND_SUITE(DriverInfoVKTest)
impeller::VendorVK::kUnknown
@ kUnknown
impeller::BackendCast< SurfaceContextVK, Context >::Cast
static SurfaceContextVK & Cast(Context &base)
Definition: backend_cast.h:13
impeller::DeviceTypeVK::kUnknown
@ kUnknown
impeller::PlaygroundTest
Definition: playground_test.h:21
context_vk.h
playground_test.h