From 85a03549f13622dac8ae7475256f02b96fd8db29 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 5 May 2020 12:23:59 -0600 Subject: DRTVWR-510 add code to report Vulkan capability in stats (Windows-only) --- indra/newview/llviewerstats.cpp | 42 +++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 85d87a43af..eccbefcd3e 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -55,7 +55,6 @@ #include "llviewerregion.h" #include "llvoavatar.h" #include "llvoavatarself.h" -#include "llviewerwindow.h" // *TODO: remove, only used for width/height #include "llworld.h" #include "llfeaturemanager.h" #include "llviewernetwork.h" @@ -582,21 +581,32 @@ void send_stats() // If the current revision is recent, ping the previous author before overriding LLSD &misc = body["stats"]["misc"]; - // Screen size so the UI team can figure out how big the widgets - // appear and use a "typical" size for end user tests. - - S32 window_width = gViewerWindow->getWindowWidthRaw(); - S32 window_height = gViewerWindow->getWindowHeightRaw(); - S32 window_size = (window_width * window_height) / 1024; - misc["string_1"] = llformat("%d", window_size); - misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds.value()); - - F32 unbaked_time = LLVOAvatar::sUnbakedTime * 1000.f / gFrameTimeSeconds; - misc["int_1"] = LLSD::Integer(unbaked_time); // Steve: 1.22 - F32 grey_time = LLVOAvatar::sGreyTime * 1000.f / gFrameTimeSeconds; - misc["int_2"] = LLSD::Integer(grey_time); // Steve: 1.22 - - LL_INFOS() << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << LL_ENDL; +#ifdef LL_WINDOWS + // Probe for Vulkan capability (Dave Houlton 05/2020) + // + // Check for presense of a Vulkan loader dll, as a proxy for a Vulkan-capable gpu. + // False-positives and false-negatives are possible, but unlikely. We'll get a good + // approximation of Vulkan capability within current user systems from this. More + // detailed information on versions and extensions can come later. + HMODULE vulkanDll = LoadLibraryExA("vulkan-1.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); + if (NULL == vulkanDll) + { + misc["string_1"] = llformat("No Vulkan driver detected"); + } + else + { + misc["string_1"] = llformat("Vulkan driver is detected"); + FreeLibrary(vulkanDll); + } +#else + misc["string_1"] = llformat("Unused"); +#endif // LL_WINDOWS + + misc["string_2"] = llformat("Unused"); + misc["int_1"] = LLSD::Integer(0); + misc["int_2"] = LLSD::Integer(0); + + LL_INFOS() << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << LL_ENDL; LL_INFOS() << "Misc Stats: string_1: " << misc["string_1"] << " string_2: " << misc["string_2"] << LL_ENDL; body["DisplayNamesEnabled"] = gSavedSettings.getBOOL("UseDisplayNames"); -- cgit v1.2.3 From c19bb9beee7f3bf2b0936db2b1c078ee38c8cc15 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Wed, 6 May 2020 11:55:02 -0600 Subject: DRTVWR-510 cache vulkan-detect result --- indra/newview/llviewerstats.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewerstats.cpp') diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index eccbefcd3e..04172adde9 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -588,16 +588,22 @@ void send_stats() // False-positives and false-negatives are possible, but unlikely. We'll get a good // approximation of Vulkan capability within current user systems from this. More // detailed information on versions and extensions can come later. - HMODULE vulkanDll = LoadLibraryExA("vulkan-1.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); - if (NULL == vulkanDll) - { - misc["string_1"] = llformat("No Vulkan driver detected"); - } - else + static bool vulkan_oneshot = false; + static bool vulkan_detected = false; + + if (!vulkan_oneshot) { - misc["string_1"] = llformat("Vulkan driver is detected"); - FreeLibrary(vulkanDll); + HMODULE vulkan_loader = LoadLibraryExA("vulkan-1.dll", NULL, LOAD_LIBRARY_AS_DATAFILE); + if (NULL != vulkan_loader) + { + vulkan_detected = true; + FreeLibrary(vulkan_loader); + } + vulkan_oneshot = true; } + + misc["string_1"] = vulkan_detected ? llformat("Vulkan driver is detected") : llformat("No Vulkan driver detected"); + #else misc["string_1"] = llformat("Unused"); #endif // LL_WINDOWS -- cgit v1.2.3