From cf692c40b0b9f8d0d04cd10a02a84e3f697a2e99 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 20 Mar 2023 10:20:06 +0100 Subject: SL-18721: Faster viewer shutdown time since performance improvements can lead to perceived inventory loss due to cache corruption --- indra/llwindow/llwindowwin32.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 41f3042ace..afe26ec5a4 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -4581,6 +4581,9 @@ std::vector LLWindowWin32::getDynamicFallbackFontList() inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread() : ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE) { + // Set this flag to true to avoid of implicit call of close() from start() + mExplicitShutdown = true; + ThreadPool::start(); } -- cgit v1.2.3 From 895ce616ea71b2001ec4e826b80310da80db9a0e Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 6 Apr 2023 21:19:44 +0300 Subject: SL-19652 Fixed 'working' cursor flicker --- indra/llwindow/llwindow.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 0edf39f6ef..802a3b5213 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -118,7 +118,8 @@ public: // Sets cursor, may set to arrow+hourglass virtual void setCursor(ECursorType cursor) { mNextCursor = cursor; }; - virtual ECursorType getCursor() const; + virtual ECursorType getCursor() const; + virtual ECursorType getNextCursor() const { return mNextCursor; }; virtual void updateCursor() = 0; virtual void captureMouse() = 0; -- cgit v1.2.3 From 79198eddf76dfa69e8161f7646d8da19853a8a5a Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Fri, 7 Jul 2023 20:24:49 +0300 Subject: SL-19966 Reverted "SL-18721: Faster viewer shutdown time since performance improvements can lead to perceived inventory loss due to cache corruption" This reverts commit cf692c40b0b9f8d0d04cd10a02a84e3f697a2e99. --- indra/llwindow/llwindowwin32.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 2f1a631585..2e560ddb0a 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -4592,9 +4592,6 @@ std::vector LLWindowWin32::getDynamicFallbackFontList() inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread() : ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE) { - // Set this flag to true to avoid of implicit call of close() from start() - mExplicitShutdown = true; - ThreadPool::start(); } -- cgit v1.2.3 From 5b2de090c1ac44c415e8573e0d6b1136cd689f35 Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Mon, 18 Sep 2023 17:05:45 -0700 Subject: SL-20177: Blind attempt at fixing crash in SetWindowLongPtr. Guess based on the fact that crashes started around the time VRAM accounting was added. --- indra/llwindow/llwindowwin32.cpp | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 1f91cbbaa8..42ec4ee29d 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -352,6 +352,11 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool void run() override; + void glReady() + { + mGLReady = true; + } + // initialzie DXGI adapter (for querying available VRAM) void initDX(); @@ -410,6 +415,9 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool HWND mWindowHandle = NULL; HDC mhDC = 0; + // *HACK: Attempt to prevent startup crashes by deferring memory accounting + // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18 + bool mGLReady = false; // best guess at available video memory in MB std::atomic mAvailableVRAM; @@ -1720,6 +1728,13 @@ const S32 max_format = (S32)num_formats - 1; // ok to post quit messages now mPostQuit = TRUE; + // *HACK: Attempt to prevent startup crashes by deferring memory accounting + // until after some graphics setup. See SL-20177. -Cosmic,2023-09-18 + mWindowThread->post([=]() + { + mWindowThread->glReady(); + }); + if (auto_show) { show(); @@ -4692,6 +4707,8 @@ void debugEnumerateGraphicsAdapters() void LLWindowWin32::LLWindowWin32Thread::initDX() { + if (!mGLReady) { return; } + if (mDXGIAdapter == NULL) { debugEnumerateGraphicsAdapters(); @@ -4726,6 +4743,8 @@ void LLWindowWin32::LLWindowWin32Thread::initDX() void LLWindowWin32::LLWindowWin32Thread::initD3D() { + if (!mGLReady) { return; } + if (mDXGIAdapter == NULL && mD3DDevice == NULL && mWindowHandle != 0) { mD3D = Direct3DCreate9(D3D_SDK_VERSION); @@ -4752,6 +4771,8 @@ void LLWindowWin32::LLWindowWin32Thread::initD3D() void LLWindowWin32::LLWindowWin32Thread::updateVRAMUsage() { LL_PROFILE_ZONE_SCOPED; + if (!mGLReady) { return; } + if (mDXGIAdapter != nullptr) { // NOTE: what lies below is hand wavy math based on compatibility testing and observation against a variety of hardware @@ -4825,8 +4846,6 @@ void LLWindowWin32::LLWindowWin32Thread::run() sWindowThreadId = std::this_thread::get_id(); LogChange logger("Window"); - initDX(); - //as good a place as any to up the MM timer resolution (see ms_sleep) //attempt to set timer resolution to 1ms TIMECAPS tc; @@ -4839,9 +4858,12 @@ void LLWindowWin32::LLWindowWin32Thread::run() { LL_PROFILE_ZONE_SCOPED_CATEGORY_WIN32; + // lazily call initD3D inside this loop to catch when mGLReady has been set to true + initDX(); + if (mWindowHandle != 0) { - // lazily call initD3D inside this loop to catch when mWindowHandle has been set + // lazily call initD3D inside this loop to catch when mWindowHandle has been set, and mGLReady has been set to true // *TODO: Shutdown if this fails when mWindowHandle exists initD3D(); -- cgit v1.2.3