From ddfcb01c30790674e7316cae14bc28c4150610a4 Mon Sep 17 00:00:00 2001 From: Alessandro Toia Date: Thu, 15 Apr 2021 15:40:12 -0700 Subject: [PATCH] Add detection of Zink --- src/gl/imgui_hud.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gl/imgui_hud.cpp b/src/gl/imgui_hud.cpp index 38f6e9c2..e97adb79 100644 --- a/src/gl/imgui_hud.cpp +++ b/src/gl/imgui_hud.cpp @@ -76,9 +76,17 @@ void imgui_init() add_blacklist(item); } auto pid = getpid(); - string command = "lsof -w -lnPX -L -p " + to_string(pid) + " | grep wined3d"; - string ret = exec(command); - ret.empty() ? sw_stats.engineName = "OpenGL" : sw_stats.engineName = "WineD3D"; + string find_wined3d = "lsof -w -lnPX -L -p " + to_string(pid) + " | grep -oh wined3d"; + string find_zink= "lsof -w -lnPX -L -p " + to_string(pid) + " | grep -oh zink"; + string ret_wined3d = exec(find_wined3d); + string ret_zink = exec(find_zink); + if (ret_wined3d == "wined3d\n" ) + sw_stats.engineName = "WineD3D"; + else if (ret_zink == "zink\n") + sw_stats.engineName = "ZINK"; + else + sw_stats.engineName = "OpenGL"; + is_blacklisted(true); notifier.params = ¶ms; start_notifier(notifier);