Commit d8ffd756 by Corentin Wallez Committed by Commit Bot

SystemInfo.h: add some documentation

BUG=angleproject:1874 Change-Id: I8898c1a467c1fec25963f45a31376a6b02e1b6c4 Reviewed-on: https://chromium-review.googlesource.com/1037584Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
parent 9aef81c7
...@@ -19,11 +19,6 @@ namespace angle ...@@ -19,11 +19,6 @@ namespace angle
using VendorID = uint32_t; using VendorID = uint32_t;
using DeviceID = uint32_t; using DeviceID = uint32_t;
constexpr VendorID kVendorID_AMD = 0x1002;
constexpr VendorID kVendorID_Intel = 0x8086;
constexpr VendorID kVendorID_Nvidia = 0x10DE;
constexpr VendorID kVendorID_Qualcomm = 0x5143;
struct GPUDeviceInfo struct GPUDeviceInfo
{ {
GPUDeviceInfo(); GPUDeviceInfo();
...@@ -47,7 +42,12 @@ struct SystemInfo ...@@ -47,7 +42,12 @@ struct SystemInfo
SystemInfo(const SystemInfo &other); SystemInfo(const SystemInfo &other);
std::vector<GPUDeviceInfo> gpus; std::vector<GPUDeviceInfo> gpus;
// Index of the primary GPU (the discrete one on dual GPU systems) in `gpus`.
// Will never be -1 after a successful GetSystemInfo.
int primaryGPUIndex = -1; int primaryGPUIndex = -1;
// Index of the currently active GPU in `gpus`, can be -1 if the active GPU could not be
// detected.
int activeGPUIndex = -1; int activeGPUIndex = -1;
bool isOptimus = false; bool isOptimus = false;
...@@ -61,8 +61,18 @@ struct SystemInfo ...@@ -61,8 +61,18 @@ struct SystemInfo
std::string primaryDisplayDeviceId; std::string primaryDisplayDeviceId;
}; };
// 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); bool GetSystemInfo(SystemInfo *info);
// Known PCI vendor IDs
constexpr VendorID kVendorID_AMD = 0x1002;
constexpr VendorID kVendorID_Intel = 0x8086;
constexpr VendorID kVendorID_Nvidia = 0x10DE;
constexpr VendorID kVendorID_Qualcomm = 0x5143;
// Predicates on vendor IDs
bool IsAMD(VendorID vendorId); bool IsAMD(VendorID vendorId);
bool IsIntel(VendorID vendorId); bool IsIntel(VendorID vendorId);
bool IsNvidia(VendorID vendorId); bool IsNvidia(VendorID vendorId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment