summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewerwin32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewerwin32.cpp')
-rw-r--r--indra/newview/llappviewerwin32.cpp119
1 files changed, 54 insertions, 65 deletions
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index ad817d5747..3e51a900ce 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -47,8 +47,10 @@
#include "llviewercontrol.h"
#include "lldxhardware.h"
+#if !_M_ARM64
#include "nvapi/nvapi.h"
#include "nvapi/NvApiDriverSettings.h"
+#endif
#include <stdlib.h>
@@ -152,8 +154,15 @@ namespace
// LL_ERRS message, when there is one
sBugSplatSender->setDefaultUserDescription(WCSTR(LLError::getFatalMessage()));
- // App state
+
+ sBugSplatSender->setAttribute(WCSTR(L"OS"), WCSTR(LLOSInfo::instance().getOSStringSimple())); // In case we ever stop using email for this
sBugSplatSender->setAttribute(WCSTR(L"AppState"), WCSTR(LLStartUp::getStartupStateString()));
+ sBugSplatSender->setAttribute(WCSTR(L"GLVendor"), WCSTR(gGLManager.mGLVendor));
+ sBugSplatSender->setAttribute(WCSTR(L"GLVersion"), WCSTR(gGLManager.mGLVersionString));
+ sBugSplatSender->setAttribute(WCSTR(L"GPUVersion"), WCSTR(gGLManager.mDriverVersionVendorString));
+ sBugSplatSender->setAttribute(WCSTR(L"GLRenderer"), WCSTR(gGLManager.mGLRenderer));
+ sBugSplatSender->setAttribute(WCSTR(L"VRAM"), WCSTR(STRINGIZE(gGLManager.mVRAM)));
+ sBugSplatSender->setAttribute(WCSTR(L"RAM"), WCSTR(STRINGIZE(gSysMemory.getPhysicalMemoryKB().value())));
if (gAgent.getRegion())
{
@@ -199,6 +208,7 @@ LONG WINAPI catchallCrashHandler(EXCEPTION_POINTERS * /*ExceptionInfo*/)
const std::string LLAppViewerWin32::sWindowClass = "Second Life";
+#if !_M_ARM64
/*
This function is used to print to the command line a text message
describing the nvapi error and quits
@@ -212,6 +222,7 @@ void nvapi_error(NvAPI_Status status)
//should always trigger when asserts are enabled
//llassert(status == NVAPI_OK);
}
+#endif
// Create app mutex creates a unique global windows object.
// If the object can be created it returns true, otherwise
@@ -234,6 +245,7 @@ bool create_app_mutex()
return result;
}
+#if !_M_ARM64
void ll_nvapi_init(NvDRSSessionHandle hSession)
{
// (2) load all the system settings into the session
@@ -388,11 +400,19 @@ void ll_nvapi_init(NvDRSSessionHandle hSession)
return;
}
}
+#endif
-int APIENTRY wWinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- PWSTR pCmdLine,
- int nCmdShow)
+//#define DEBUGGING_SEH_FILTER 1
+#if DEBUGGING_SEH_FILTER
+# define WINMAIN DebuggingWinMain
+#else
+# define WINMAIN wWinMain
+#endif
+
+int APIENTRY WINMAIN(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ PWSTR pCmdLine,
+ int nCmdShow)
{
// Call Tracy first thing to have it allocate memory
// https://github.com/wolfpld/tracy/issues/196
@@ -450,6 +470,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
return -1;
}
+#if !_M_ARM64
NvDRSSessionHandle hSession = 0;
static LLCachedControl<bool> use_nv_api(gSavedSettings, "NvAPICreateApplicationProfile", true);
if (use_nv_api)
@@ -474,6 +495,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
}
}
}
+#endif
// Have to wait until after logging is initialized to display LFH info
if (num_heaps > 0)
@@ -531,16 +553,39 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
delete viewer_app_ptr;
viewer_app_ptr = NULL;
+#if !_M_ARM64
// (NVAPI) (6) We clean up. This is analogous to doing a free()
if (hSession)
{
NvAPI_DRS_DestroySession(hSession);
hSession = 0;
}
+#endif
return 0;
}
+#if DEBUGGING_SEH_FILTER
+// The compiler doesn't like it when you use __try/__except blocks
+// in a method that uses object destructors. Go figure.
+// This winmain just calls the real winmain inside __try.
+// The __except calls our exception filter function. For debugging purposes.
+int APIENTRY wWinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ PWSTR lpCmdLine,
+ int nCmdShow)
+{
+ __try
+ {
+ WINMAIN(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
+ }
+ __except( viewer_windows_exception_handler( GetExceptionInformation() ) )
+ {
+ _tprintf( _T("Exception handled.\n") );
+ }
+}
+#endif
+
void LLAppViewerWin32::disableWinErrorReporting()
{
std::string executable_name = gDirUtilp->getExecutableFilename();
@@ -769,14 +814,16 @@ bool LLAppViewerWin32::cleanup()
return result;
}
-void LLAppViewerWin32::reportCrashToBugsplat(void* pExcepInfo)
+bool LLAppViewerWin32::reportCrashToBugsplat(void* pExcepInfo)
{
#if defined(LL_BUGSPLAT)
if (sBugSplatSender)
{
sBugSplatSender->createReport((EXCEPTION_POINTERS*)pExcepInfo);
+ return true;
}
#endif // LL_BUGSPLAT
+ return false;
}
void LLAppViewerWin32::initLoggingAndGetLastDuration()
@@ -805,69 +852,11 @@ void write_debug_dx(const std::string& str)
bool LLAppViewerWin32::initHardwareTest()
{
- //
- // Do driver verification and initialization based on DirectX
- // hardware polling and driver versions
- //
- if (true == gSavedSettings.getBOOL("ProbeHardwareOnStartup") && false == gSavedSettings.getBOOL("NoHardwareProbe"))
- {
- // per DEV-11631 - disable hardware probing for everything
- // but vram.
- bool vram_only = true;
-
- LLSplashScreen::update(LLTrans::getString("StartupDetectingHardware"));
-
- LL_DEBUGS("AppInit") << "Attempting to poll DirectX for hardware info" << LL_ENDL;
- gDXHardware.setWriteDebugFunc(write_debug_dx);
- bool probe_ok = gDXHardware.getInfo(vram_only);
-
- if (!probe_ok
- && gWarningSettings.getBOOL("AboutDirectX9"))
- {
- LL_WARNS("AppInit") << "DirectX probe failed, alerting user." << LL_ENDL;
-
- // Warn them that runnin without DirectX 9 will
- // not allow us to tell them about driver issues
- std::ostringstream msg;
- msg << LLTrans::getString ("MBNoDirectX");
- S32 button = OSMessageBox(
- msg.str(),
- LLTrans::getString("MBWarning"),
- OSMB_YESNO);
- if (OSBTN_NO== button)
- {
- LL_INFOS("AppInit") << "User quitting after failed DirectX 9 detection" << LL_ENDL;
- LLWeb::loadURLExternal("http://secondlife.com/support/", false);
- return false;
- }
- gWarningSettings.setBOOL("AboutDirectX9", false);
- }
- LL_DEBUGS("AppInit") << "Done polling DirectX for hardware info" << LL_ENDL;
-
- // Only probe once after installation
- gSavedSettings.setBOOL("ProbeHardwareOnStartup", false);
-
- // Disable so debugger can work
- std::string splash_msg;
- LLStringUtil::format_map_t args;
- args["[APP_NAME]"] = LLAppViewer::instance()->getSecondLifeTitle();
- splash_msg = LLTrans::getString("StartupLoading", args);
-
- LLSplashScreen::update(splash_msg);
- }
-
if (!restoreErrorTrap())
{
- LL_WARNS("AppInit") << " Someone took over my exception handler (post hardware probe)!" << LL_ENDL;
+ LL_WARNS("AppInit") << " Someone took over my exception handler!" << LL_ENDL;
}
- if (gGLManager.mVRAM == 0)
- {
- gGLManager.mVRAM = gDXHardware.getVRAM();
- }
-
- LL_INFOS("AppInit") << "Detected VRAM: " << gGLManager.mVRAM << LL_ENDL;
-
return true;
}