summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2020-05-06 11:55:02 -0600
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-06-08 23:54:09 +0300
commite1ea8eb7738c2f9a6762dd8c6c22de00607e8ba2 (patch)
treeb15ed66f0efe49b2163ef36a8203bd0a1335a801
parent0defa9be8304cd80b5562dddb6e0f10219192a7f (diff)
DRTVWR-510 cache vulkan-detect result
-rw-r--r--indra/newview/llviewerstats.cpp22
1 files changed, 14 insertions, 8 deletions
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