// // Copyright 2013 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. //
// SystemInfo.h: gathers information available without starting a GPU driver.
// Returns the index to `gpus` if the entry matches the preferred device string.
std::optional<size_t> getPreferredGPUIndex() const;
std::vector<GPUDeviceInfo> gpus;
// Index of the GPU expected to be used for 3D graphics. Based on a best-guess heuristic on // some platforms. On Windows, this is accurate. Note `gpus` must be checked for empty before // indexing. int activeGPUIndex = 0;
bool isOptimus = false; bool isAMDSwitchable = false; // Only true on dual-GPU Mac laptops. bool isMacSwitchable = false; // Only true on Apple Silicon Macs when running in macCatalyst. bool needsEAGLOnMac = false;
// Only available on Android
std::string machineManufacturer; int androidSdkLevel = 0;
// Only available on macOS and Android
std::string machineModelName;
// Only available on macOS
std::string machineModelVersion;
};
// Gathers information about the system without starting a GPU driver and returns them in `info`. // Returns true if all info was gathered, false otherwise. Even when false is returned, `info` will // be filled with partial information. bool GetSystemInfo(SystemInfo *info);
// Vulkan-specific info collection. bool GetSystemInfoVulkan(SystemInfo *info);
// Returns a readable vendor name given the VendorID
std::string VendorName(VendorID vendor);
// Use a heuristic to attempt to find the GPU used for 3D graphics. Sets activeGPUIndex, // isOptimus, and isAMDSwitchable. // Always assumes the non-Intel GPU is active on dual-GPU machines. void GetDualGPUInfo(SystemInfo *info);
// Dumps the system info to stdout. void PrintSystemInfo(const SystemInfo &info);
#ifdefined(ANGLE_PLATFORM_MACOS) || defined(ANGLE_PLATFORM_MACCATALYST) // Helper to get the active GPU ID from a given Core Graphics display ID.
uint64_t GetGpuIDFromDisplayID(uint32_t displayID);
// Helper to get the active GPU ID from an OpenGL display mask.
uint64_t GetGpuIDFromOpenGLDisplayMask(uint32_t displayMask);
// Get VendorID from metal device's registry ID
VendorID GetVendorIDFromMetalDeviceRegistryID(uint64_t registryID); #endif
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.