Commit Graph

44187 Commits (7f2e740591ed7afa5b8da620802dbdca40da7f4c)

Author SHA1 Message Date
Andrey Kleshchev 7f2e740591 SL-15333 Crash in glh_init_extensions 2021-11-19 14:43:19 -05:00
Brad Payne (Vir Linden) 0d4c6ee572 SL-16355 - spammy message removed 2021-11-19 14:43:19 -05:00
Mnikolenko Productengine ca4fb96e1d SL-16330 mac build fix 2021-11-19 14:43:19 -05:00
Brad Payne (Vir Linden) 730b8427b5 SL-16329 - track frame time and jitter (as average deviation frame to frame) in stats window 2021-11-19 14:43:19 -05:00
Nat Goodspeed 18de6c9b98 SL-16094: Stylish braces! 2021-11-19 14:43:19 -05:00
Nat Goodspeed bbf3f516bd SL-16094: Only link IMM32.LIB for llurlentry tests on Windows. 2021-11-19 14:43:19 -05:00
Nat Goodspeed a633efdc0b SL-16094: In LLWindowWin32::recreateWindow(), kick window thread
before blocking on the pending future. Otherwise the window thread can remain
blocked in a GetMessage() call and deadlock the app.
2021-11-15 14:34:30 -05:00
Nat Goodspeed 1a39a8f7d9 Merge branch 'DRTVWR-546' into glthread 2021-11-10 10:28:58 -05:00
Nat Goodspeed 214d8d40c1 SL-16094: Statically link to Windows IMM32.LIB.
llwindowwin32.cpp's LLWinImm class used to dynamically load IMM32.DLL and
populate its methods using GetProcAddress(). That was to support Windows XP.
Since we've dropped Windows XP, use static linking instead, with dramatically
fewer lines of code (and less of a thread safety alarm trigger).

We retain the LLWinImm wrapper class only as a hook for Tracy instrumentation.
2021-11-10 10:17:12 -05:00
Nat Goodspeed df8e17d8e8 SL-16094: Add WorkQueue::size() method to support changeset 08336bb.
We want to skip calling PostMessage() to bump the window thread out of
GetMessage() in any frame with no work functions pending for that thread. That
test depends on being able to sense the size() of the queue. Having converted
to WorkQueue, we need that queue to support size().
2021-11-10 10:13:38 -05:00
Mnikolenko Productengine 7c561ca1c7 SL-16330 move VSync checkbox to General group 2021-11-10 13:02:18 +02:00
Mnikolenko Productengine 768b7a4d33 SL-16330 Clean up vertical sync handling, add to UI 2021-11-09 17:17:49 +02:00
Nat Goodspeed 08336bb469 SL-16094: Zap thread safety land mine; thin PostMessage() calls.
LLWindowWin32::mWndProc was a public WNDPROC member. If set non-NULL,
mainWindowProc() would call that before falling into its own handler code. But
now, mWndProc would be called on the window thread instead of on the main
thread. Running arbitrary callback code on the window thread could cause all
sorts of problems.

It could be made safe by posting the callback call to the "mainloop" WorkQueue
for execution on the main thread. But as no code actually references it,
delete it instead.

Per DaveP, the recent change to LLWindowsWin32Thread::post() could end up
calling PostMessage() many times per frame, with nontrivial overhead.
Reinstate the more selective code that calls PostMessage() with the dummy
message (to bust us out of GetMessage() to check pending window-thread work
requests) at most once per frame.
2021-11-08 15:15:56 -05:00
Nat Goodspeed c7af4921db SL-16094: Use ThreadPool for LLWindowWin32Thread.
Move the whole LLWindowWin32Thread class inside LLWindowWin32, and make it a
struct. Migrate the struct declaration to llwindowwin32.cpp.

Derive it from ThreadPool, which provides the WorkQueue. Use runPending()
instead of manually popping and running individual queue items.

Make its post() operation always PostMessage(bogus) whenever we put an entry
in the WorkQueue, so we won't remain blocked in GetMessage().

Instead of storing a back pointer to the LLWindowWin32 instance, store the
relevant HWND and HDC in LLWindowWin32Thread itself to avoid cross-thread
timing problems.

Extract both instances of a large duplicated block of LLWindowWin32 code to a
new recreateWindow() method, and call it in those places. Per the TODO, use a
std::future to pass the new HWND and HDC back to LLWindowWin32 -- but also
store them locally on the LLWindowWin32Thread instance.
2021-11-05 17:20:11 -04:00
Nat Goodspeed ff5496239b SL-16202: Use WorkQueue::postTo() for texture create/post handshake.
That is, when LLViewerFetchedTexture::scheduleCreateTexture() wants to call
createTexture() on the LLImageGLThread, but postCreateTexture() on the main
thread, use the "mainloop" WorkQueue to set up the handshake.

Give ThreadPool a public virtual run() method so a subclass can override with
desired behavior. This necessitates a virtual destructor. Add accessors for
embedded WorkQueue (for post calls), ThreadPool name and width (in threads).

Allow LLSimpleton::createInstance() to forward arguments to the subject
constructor.

Make LLImageGLThread an LLSimpleton - that abstraction didn't yet exist at the
time LLImageGLThread was coded. Also derive from ThreadPool rather than
LLThread. Make it a single-thread "pool" with a very large queue capacity.
2021-11-05 12:33:31 -04:00
Mnikolenko Productengine b6afa7f7dd SL-16288 FIXED Dragging a file across the viewer cancels the drag and freezes the File Explorer 2021-11-05 17:48:40 +02:00
Euclid Linden 7cdaebaefe Merged in euclid-14098 (pull request #762)
SL-14098, enable occlusion culling during reflection pass

Approved-by: Michael Pohoreski
2021-11-05 15:35:20 +00:00
Dave Houlton 747ccda0b4 SL-14098 re-enable occlusion culling during reflection pass 2021-11-04 16:21:17 -06:00
Dave Houlton 5e9351a41a SL-13565 occlusion/reflection tracy markup 2021-11-04 16:19:18 -06:00
Nat Goodspeed 834e7ca088 SL-16202: Use large WorkQueue size limits for mainloop and General.
Give ThreadPool and WorkQueue the ability to override default
ThreadSafeSchedule capacity.

Instantiate "mainloop" WorkQueue and "General" ThreadPool with very large
capacity because we never want to have to block trying to push to either.
2021-11-04 17:18:57 -04:00
Nat Goodspeed d848d9e888 SL-16202: Streamline WorkQueues in LLImageGLThread.
Use the new WorkQueue::postIfOpen() method in LLImageGLThread::post(). That
makes the LLImageGLThread method a trivial wrapper, which can accept templated
work items and pass them through to the WorkQueue method, eliminating double
indirection due to multiple layers of std::function.

Eliminate LLImageGLThread's WorkQueue intended for work on the main queue.
Since the main loop already has a WorkQueue of its own, post work directly to
that WorkQueue instead of using a separate WorkQueue misleadingly embedded in
LLImageGLThread.

Instead of looking up the main thread's WorkQueue every time, capture a
pointer in LLImageGL's constructor.

We no longer need a fallback queue for when the main thread's WorkQueue is
full. We no longer need the main loop to poll LLImageGL to service the local
main-thread-targeted WorkQueue, or to copy work from the fallback queue to the
main queue. That eliminates LLImageGLThread::postCallback(), mCallbackQueue,
mPendingCallbackQ, executeCallbacks() -- and even LLImageGL::updateClass() and
LLAppViewer's call to it.

Change LLViewerFetchedTexture::scheduleCreateTexture() to post work to the
main thread's WorkQueue instead of calling LLImageGLThread::postCallback().
2021-11-04 16:50:31 -04:00
Nat Goodspeed 89f2169e9d SL-16202: Add postIfOpen() methods to WorkQueue, LLThreadSafeQueue.
postIfOpen() provides a no-exception alternative to post(), which blocks if
full but throws if closed. postIfOpen() likewise blocks if full, but returns
true if able to post and false if the queue was closed.
2021-11-04 16:43:11 -04:00
Nat Goodspeed 8458ad8890 SL-16202: Instantiate LLSimpleton::sInstance generically
instead of requiring a separate declaration for each subclass.

The previous way produces errors in clang.
2021-11-04 16:40:05 -04:00
Nat Goodspeed 7a5b921995 SL-16202: Merge branch 'sl-16220' into glthread 2021-11-04 15:40:30 -04:00
Mnikolenko Productengine 3faba7515c SL-16237 FIXED Viewer hangs on login 2021-11-01 19:38:55 +02:00
Michael Pohoreski 2369af6999 Merged in SL-16127_More_tweaks (pull request #752)
SL-16127 More tweaks

Approved-by: Euclid Linden
Approved-by: Dave Parks
2021-11-01 16:30:01 +00:00
Ptolemy 1be8a8d10b Fix merge conflict 2021-10-29 15:11:42 -07:00
Dave Parks 68b75be652 SL-9436 Don't render 100% transparent objects. 2021-10-28 22:09:22 +00:00
Dave Parks 8d20480c5f SL-16148 SL-16244 SL-16270 SL-16253 Remove most BlockTimers, remove LLMemTracked, introduce alignas, hook most/all reamining allocs, disable synchronous occlusion, and convert frequently accessed LLSingletons to LLSimpleton 2021-10-28 18:06:21 +00:00
Nat Goodspeed 8b16ecb9cf SL-16220: Add tests for WorkQueue::waitForResult(), void & non-void. 2021-10-27 15:31:54 -04:00
Ptolemy 61bca72d37 Merge branch 'SL-16127_More_tweaks' of bitbucket.org:lindenlab/viewer into SL-16127_More_tweaks 2021-10-27 10:22:03 -07:00
Ptolemy ad91d0fd92 SL-16127: Make another pass removing redundant LLSD op [] calls, unused vars, and use atmospheric already calculated 2021-10-27 10:05:13 -07:00
Michael Pohoreski aa7ca0aea1 Merged in SL-16127 (pull request #741)
SL-16127

Approved-by: Euclid Linden
Approved-by: Dave Parks
2021-10-27 15:59:53 +00:00
Ptolemy 1f00c43201 SL-16127: Make another pass removing redundant LLSD op [] calls, unused vars, and use atmospheric already calculated 2021-10-26 22:09:27 -07:00
Nat Goodspeed f06765cba8 SL-16220: Make WorkQueue::postTo() return exception to caller.
postTo() sets up two-way communication: the caller asks to run work on some
other WorkQueue, expecting an eventual callback on the originating WorkQueue.
That permits us to transport any exception thrown by the work callable back to
rethrow on the originating WorkQueue.
2021-10-26 12:29:49 -04:00
Nat Goodspeed e6eebea8da SL-16220: Change WorkQueue::runOn() to waitForResult().
In addition to the name making the blocking explicit, we changed the
signature: instead of specifying a target WorkQueue on which to run,
waitForResult() runs the passed callable on its own WorkQueue.

Why is that? Because, unlike postTo(), we do not require a handshake between
two different WorkQueues. postTo() allows running arbitrary callback code,
setting variables or whatever, on the originating WorkQueue (presumably on the
originating thread). waitForResult() synchronizes using Promise/Future, which
are explicitly designed for cross-thread communication. We need not call
set_value() on the originating thread, so we don't need a postTo() callback
lambda.
2021-10-26 11:49:53 -04:00
Runitai Linden c907d067f4 SL-16243 Followup -- fix for inconsistently calling TracyAlloc/TracyFree 2021-10-26 09:23:17 -05:00
Dave Parks 4e8cd9437b SL-16193 Fix for mesh selection outline not rendering correctly (and broken physics shapes display). 2021-10-26 14:07:00 +00:00
Dave Houlton 081ae57831 SL-16246 protect null deference 2021-10-25 16:27:34 -06:00
Nat Goodspeed 023d39963e SL-16220: WorkQueue::runOn() methods submit work, wait for result.
The idea is that you can call runOn(target, callable) from a (non-default)
coroutine and block that coroutine until the result becomes available.

As a safety check, we forbid calling runOn() from a thread's default
coroutine, assuming that a given thread's default coroutine is the one
servicing the relevant WorkQueue.
2021-10-25 17:31:27 -04:00
Dave Parks 647d0224d3 SL-16243 Add Tracy timers to global new/delete overrides. 2021-10-25 21:11:03 +00:00
Nat Goodspeed e7b8c27741 SL-16220: Specialize WorkQueue for callable with void return.
Add a test exercising this feature.
2021-10-25 15:55:49 -04:00
Mnikolenko Productengine a5b1c01354 SL-16234 handle closing floater correctly 2021-10-25 21:23:26 +03:00
Vir Linden c173b07b72 Merged in SL-15999 (pull request #746)
SL-15999 support --noninteractive option for viewer

Approved-by: Dave Parks
Approved-by: Michael Pohoreski
2021-10-25 15:55:31 +00:00
Vir Linden ba3459f77f Merged DRTVWR-546 into SL-15999 2021-10-25 15:55:06 +00:00
Nat Goodspeed d2763897f2 SL-16220: Fix thread name expression. 2021-10-22 21:51:44 -04:00
Ptolemy 2c2f6f2a9b Merge branch 'DRTVWR-546' into SL-16127 2021-10-22 15:15:07 -07:00
Runitai Linden 3efd4c50a0 SL-16222 Don't use bindFast for legacy bump maps (weird loading path sometimes has stale texture state). 2021-10-22 16:56:20 -05:00
Brad Payne (Vir Linden) a42b5d6809 SL-15999 - made cwd handling a bit more robust in perfbot_run.py 2021-10-22 18:49:54 +01:00
Brad Payne (Vir Linden) e5cd9cb90f merge 2021-10-22 18:11:48 +01:00