10#include "flutter/fml/build_config.h"
60 return "ImgTec PowerVR";
80 return "Integrated GPU";
82 return "Discrete GPU";
93 case vk::PhysicalDeviceType::eOther:
95 case vk::PhysicalDeviceType::eIntegratedGpu:
97 case vk::PhysicalDeviceType::eDiscreteGpu:
99 case vk::PhysicalDeviceType::eVirtualGpu:
101 case vk::PhysicalDeviceType::eCpu:
109 auto props =
device.getProperties();
115 FML_LOG(WARNING) <<
"Unknown GPU Driver Vendor: " << props.vendorID
116 <<
". This is not an error.";
119 if (props.deviceName.data() !=
nullptr) {
120 driver_name_ = props.deviceName.data();
143 std::vector<std::pair<std::string, std::string>> items;
144 items.emplace_back(
"Name", driver_name_);
145 items.emplace_back(
"API Version", api_version_.
ToString());
152 for (
const auto& item : items) {
153 padding =
std::max(padding, item.first.size());
162 stream <<
"--- Driver Information ------------------------------------------";
166 for (
const auto& item : items) {
167 stream <<
"| " << std::setw(
static_cast<int>(padding)) << item.first
168 << std::setw(0) <<
": " << item.second << std::endl;
171 stream <<
"-----------------------------------------------------------------";
180 driver_name_.find(
"SwiftShader") != std::string::npos) {
const VendorVK & GetVendor() const
Get the vendor of the Vulkan implementation. This is a broad check and includes multiple drivers and ...
DriverInfoVK(const vk::PhysicalDevice &device)
const std::string & GetDriverName() const
Get the self-reported name of the graphics driver.
void DumpToLog() const
Dumps the current driver info to the log.
bool IsEmulator() const
Determines if the driver represents an emulator. There is no definitive way to tell if a driver is an...
const DeviceTypeVK & GetDeviceType() const
Get the device type. Typical use might be to check if the device is a CPU implementation.
const Version & GetAPIVersion() const
Gets the Vulkan API version. Should be at or above Vulkan 1.1 which is the Impeller baseline.
#define FML_LOG(severity)
#define FML_UNREACHABLE()
static float max(float r, float g, float b)
constexpr VendorVK IdentifyVendor(uint32_t vendor)
constexpr const char * DeviceTypeToString(DeviceTypeVK type)
constexpr const char * VendorToString(VendorVK vendor)
constexpr DeviceTypeVK ToDeviceType(const vk::PhysicalDeviceType &type)
static SkString to_string(int n)
std::string ToString() const
#define VK_API_VERSION_PATCH(version)
#define VK_API_VERSION_MINOR(version)
#define VK_API_VERSION_MAJOR(version)