From 822bb66629ca41fd67fb34d94a4c4d0f602daf13 Mon Sep 17 00:00:00 2001 From: jackun Date: Sun, 6 Mar 2022 21:57:41 +0200 Subject: [PATCH] Fix confusing vendorID with deviceID OpenGL still needs some work to select the actual render device >:( --- src/overlay.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/overlay.cpp b/src/overlay.cpp index b61b90c..d43f9be 100644 --- a/src/overlay.cpp +++ b/src/overlay.cpp @@ -608,16 +608,18 @@ void init_gpu_stats(uint32_t& vendorID, uint32_t reported_deviceID, overlay_para } fclose(fp); } + string vendor = path + "/device/vendor"; if ((fp = fopen(vendor.c_str(), "r"))){ uint32_t temp = 0; - if (fscanf(fp, "%x", &temp) != 1 || temp != vendorID) { + if (fscanf(fp, "%x", &temp) != 1 || temp != 0x1002) { fclose(fp); continue; } fclose(fp); } - if (deviceID != 0x1002 || !file_exists(path + "/device/gpu_busy_percent")) + + if (!file_exists(path + "/device/gpu_busy_percent")) continue; if (pci_bus_parsed && pci_dev) {