diff options
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 730e658c6a..64f20e65ca 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -160,7 +160,18 @@ HGLRC SafeCreateContext(HDC &hdc) GLuint SafeChoosePixelFormat(HDC &hdc, const PIXELFORMATDESCRIPTOR *ppfd) { - return LL::seh::catcher([hdc, ppfd]{ return ChoosePixelFormat(hdc, ppfd); }); + __try + { + return ChoosePixelFormat(hdc, ppfd); + } + __except (EXCEPTION_EXECUTE_HANDLER) + { + // convert to C++ styled exception + // C exception don't allow classes, so it's a regular char array + char integer_string[32]; + sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode()); + throw std::exception(integer_string); + } } //static @@ -565,6 +576,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, // Make an instance of our window then define the window class mhInstance = GetModuleHandle(NULL); +#if !_M_ARM64 // Init Direct Input - needed for joystick / Spacemouse LPDIRECTINPUT8 di8_interface; @@ -579,6 +591,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, { gDirectInput8 = di8_interface; } +#endif mSwapMethod = SWAP_METHOD_UNDEFINED; @@ -4681,9 +4694,18 @@ void LLWindowWin32::LLWindowWin32Thread::checkDXMem() if (phys_mb > 0) { - // Intel uses 'shared' vram, cap it to 25% of total memory - // Todo: consider caping all adapters at least to 50% ram - budget_mb = llmin(budget_mb, (UINT64)(phys_mb * 0.25)); + if (gGLManager.mIsIntel) + { + // Intel uses 'shared' vram, cap it to 25% of total memory + // Todo: consider a way of detecting integrated Intel and AMD + budget_mb = llmin(budget_mb, (UINT64)(phys_mb * 0.25)); + } + else + { + // More budget is generally better, but the way viewer + // utilizes even dedicated VRAM leaves a footprint in RAM + budget_mb = llmin(budget_mb, (UINT64)(phys_mb * 0.75)); + } } else { |