summaryrefslogtreecommitdiff
path: root/indra/llcommon
AgeCommit message (Collapse)Author
2021-12-26Merge branch 'master' into DRTVWR-543-maintAndrey Lihatskiy
2021-12-26Merge branch 'master' into DRTVWR-540-maintAndrey Lihatskiy
2021-12-16Merge branch 'SL-15742' into DRTVWR-527-maintAndrey Lihatskiy
2021-12-15DRTVWR-546 merge up to 6.5.2Dave Houlton
2021-12-15Merge branch 'master' into DRTVWR-530-maintAndrey Lihatskiy
2021-12-15Merge branch 'master' (DRTVWR-552) into DRTVWR-527-maintAndrey Kleshchev
# Conflicts: # indra/media_plugins/cef/media_plugin_cef.cpp - setOnLoadEndCallback # indra/newview/llviewerassetstorage.cpp - mAssetCoroCount
2021-12-11Merge branch 'master' into SL-15742Bennett Goble
2021-12-10SL-15742: Convert build scripts to Python 3Bennett Goble
This changeset makes it possible to build the Second Life viewer using Python 3. It is designed to be used with an equivalent Autobuild branch so that a developer can compile without needing Python 2 on their machine. Breaking change: Python 2 support ending Rather than supporting two versions of Python, including one that was discontinued at the beginning of the year, this branch focuses on pouring future effort into Python 3 only. As a result, scripts do not need to be backwards compatible. This means that build environments, be they on personal computers and on build agents, need to have a compatible interpreter. Notes - SLVersionChecker will still use Python 2 on macOS - Fixed the message template url used by template_verifier.py
2021-11-24SL-16094: Fix WorkQueue test for correct behavior of runFor().Nat Goodspeed
Turns out that one of our WorkQueue integration tests was relying on the incorrect runFor() behavior that we just fixed, so the test broke. Now that runFor() doesn't wait around for work to be posted, use an explicit wait loop instead. To support this, add LLCond::get(functor), where functor must accept a const reference to the stored data. This new get() returns whatever the functor returns, allowing a caller to peek at the stored data. Also use universal references for all remaining LLCond functor arguments.
2021-11-24DRTVWR-546, SL-16220, SL-16094: Undo previous glthread branch revert.Nat Goodspeed
Reverting a merge is sticky: it tells git you never want to see that branch again. Merging the DRTVWR-546 branch, which contained the revert, into the glthread branch undid much of the development work on that branch. To restore it we must revert the revert. This reverts commit 029b41c0419e975bbb28454538b46dc69ce5d2ba.
2021-11-24SL-16400: Make WorkQueue::runFor() and runUntil() stop when done.Nat Goodspeed
runFor(interval) and runUntil(timestamp) are intended, and documented, to run *no longer than* the specified time. Instead, the initial implementation always waited the full specified time, hoping for work to arrive. Fix that: once we clear work that's already pending, return right away.
2021-11-24SL-16094: Fix merge glitches from previous revert.Nat Goodspeed
2021-11-23SL-16094, SL-16400: Merge branch 'DRTVWR-546' into glthreadNat Goodspeed
2021-11-23SL-16400: Add ThreadPool::start() method, and call it.Nat Goodspeed
It's sometimes important to finish other initialization before launching the threads in the ThreadPool, so make that an explicit step. In particular, we were launching the LLImageGL texture thread before initializing the GL context, resulting in all gray textures.
2021-11-23Merge branch 'glthread' of ssh://bitbucket.org/lindenlab/viewer into glthreadxNat Goodspeed
2021-11-23SL-16094: Support ll_convert<std::string>(const char*)Nat Goodspeed
and correspondingly, ll_convert<std::wstring>(const wchar_t*). Now that we're using ll_convert() for single-argument stringize(arg), make sure it can efficiently handle the simple case of constructing a string from a const char pointer.
2021-11-23SL-16094: Tweak llstring mergeNat Goodspeed
2021-11-23SL-16094: Merge llstring work from SL-16207Nat Goodspeed
2021-11-23SL-16094: Extend stringize() to support variadic arguments.Nat Goodspeed
It's useful to be able to say STRINGIZE(item0 << item1 << item2), and we use that a lot in our code base. But weird syntax aside, there are a couple advantages to being able to write stringize(item0, item1, item2). First, it allows stringize() to be used from within some other variadic function, without having to make that function a macro that accepts an arbitrary insertion-operator expression. There's no such thing as a member macro. Second, particularly for variadic functions, it allows us to optimize the single-argument case stringize(item0). A macro can't do that. When item0 is already a string of the desired char type, instead of streaming it into a std::ostringstream and retrieving it again, we can simply return the input string. When it's a pointer to the desired char type, we can directly construct the result string without the help of std::ostringstream. When it's a string of some other char type, we can engage ll_convert() to perform needed conversions. We generalize and optimize the generic gstringize() function, retaining the role of stringize() and wstringize() as thin wrappers that merely provide the desired char type. Optimizing the single-argument case requires separately defining gstringize() with two or more arguments: the general case. Then gstringize(arg) is delegated to a gstringize_impl class template so we can partially specialize to recognize a std::basic_string<desired_char_type> argument, as well as desired_char_type*. Both these specializations engage ll_convert(), which already handles the trivial case when no conversion is required. Use of ll_convert() in this role supercedes and generalizes the previous wstring_to_utf8str() and utf8str_to_wstring() overloads. Also introduce stream_to(std::ostream&, ...) to support variadic streaming to other destinations, e.g. a file, std::cout, ...
2021-11-22SL-16094 More profile hooks for threading code, remove redundant ↵Runitai Linden
wglCreateContextAttribs call
2021-11-22SL-16094 Add WorkQueue profile hooksRunitai Linden
2021-11-19SL-16094: fix merge glitchNat Goodspeed
2021-11-19SL-16094: Stylish braces!Nat Goodspeed
(cherry picked from commit 18de6c9b989cc7060f2a314f5b68cc102677823b)
2021-11-19SL-16202: Instantiate LLSimpleton::sInstance genericallyNat Goodspeed
instead of requiring a separate declaration for each subclass. The previous way produces errors in clang. (cherry picked from commit 8458ad8890cf0a11804996210d7bcfbdaa3eec2e)
2021-11-19SL-16329 - track frame time and jitter (as average deviation frame to frame) ↵Brad Payne (Vir Linden)
in stats window
2021-11-19SL-16094: Stylish braces!Nat Goodspeed
2021-11-19Merge branch 'master' into DRTVWR-540-maintAndrey Lihatskiy
# Conflicts: # indra/newview/llfloatereditextdaycycle.cpp # indra/newview/llviewerinput.cpp
2021-11-19Merge branch 'master' into DRTVWR-543-maintAndrey Lihatskiy
# Conflicts: # indra/newview/llagentwearables.cpp # indra/newview/llvoicevivox.cpp
2021-11-17SL-15241 CleanupAndrey Kleshchev
2021-11-16DRTVWR-546 merge in master v6.5.1Dave Houlton
2021-11-16Merge branch 'master' into DRTVWR-519Andrey Lihatskiy
# Conflicts: # README.md
2021-11-16Merge branch 'master' into DRTVWR-530-maintAndrey Lihatskiy
# Conflicts: # doc/contributions.txt
2021-11-16Merge branch 'master' into DRTVWR-527-maintAndrey Lihatskiy
# Conflicts: # autobuild.xml # indra/newview/installers/windows/lang_pl.nsi # indra/newview/llfloaterpreference.cpp # indra/newview/llinventorymodel.cpp
2021-11-15Revert "SL-16220: Merge branch 'origin/DRTVWR-546' into glthread"Dave Houlton
This reverts commit 5188a26a8521251dda07ac0140bb129f28417e49, reversing changes made to 819088563e13f1d75e048311fbaf0df4a79b7e19.
2021-11-12SL-16220: Merge branch 'origin/DRTVWR-546' into glthreadNat Goodspeed
2021-11-11SL-16094: Stylish braces!Nat Goodspeed
2021-11-10SL-16094: Add WorkQueue::size() method to support changeset 08336bb.Nat Goodspeed
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-09Merged DRTVWR-546 into SL-16329Vir Linden
2021-11-09SL-16329 - track frame time and jitter (as average deviation frame to frame) ↵Brad Payne (Vir Linden)
in stats window
2021-11-05SL-16202: Use WorkQueue::postTo() for texture create/post handshake.Nat Goodspeed
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-04SL-16202: Use large WorkQueue size limits for mainloop and General.Nat Goodspeed
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-04SL-16202: Add postIfOpen() methods to WorkQueue, LLThreadSafeQueue.Nat Goodspeed
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-04SL-16202: Instantiate LLSimpleton::sInstance genericallyNat Goodspeed
instead of requiring a separate declaration for each subclass. The previous way produces errors in clang.
2021-11-04SL-16202: Merge branch 'sl-16220' into glthreadNat Goodspeed
2021-11-02SL-16207: Fix bug in ll_convert_string_to_utf8_string().Nat Goodspeed
That function wants to pass a code_page to ll_convert_string_to_wide(), but the code_page parameter was being mistaken for the length parameter, leading to access violations.
2021-11-02Manually resolving conflicts after merge with DRTVWR-520Andrey Kleshchev
This reverts commit 0a745b47880fb16b1db8cd3327377a383dbfe6a8.
2021-11-02SL-16207: Guess Microsoft compiler isn't smart about default params?Nat Goodspeed
clang allows us to specify, as a default function parameter, an expression involving a preceding parameter, e.g. (char* ptr, size_t len=strlen(ptr)). The Microsoft compiler produces errors, requiring more overloads to address that. Also #undef llstring.h's declaration helper macros at the bottom of the file. Once we've used them to declare stuff, they need not (should not) be visible to the consuming source file.
2021-11-02SL-16207: Create uniform overload sets for wide-string conversions.Nat Goodspeed
Use new ll_convert_forms() macro in llstring.h to declare, for each wide-string conversion function of interest, four overloads. The real one, the nontrivial one, is (const char*, size_t len), implemented in llstring.cpp. Then (const string&, size_t len), (const char*) and (const string&) are each trivially implemented with an inline call to (const char*, size_t len). Notably, we change all S32 len parameters to size_t. Using S32 is old skool. Tweak each nontrivial implementation in llstring.cpp to accept (const char*, size_t len) instead of (const string&) with or without explicit length. Eliminate from llstring.cpp trivial overloads (deriving length from either a const char* or from a string), since those are now inline in the header. Of course three of those overloads will be unified once we enable C++17 and change each relevant parameter to std::string_view, but we're not yet there. Meanwhile, this suite of overloads minimizes, to the best of our ability, new string allocations solely for parameter passing. And use of a macro means we need only change the macro once we get std::string_view. We take this step because some use cases require (const char*), some require (const string&, size_t len), others (const char*, size_t len) ... We were missing some key overloads, and had to work around them by instantiating new string objects (necessitating both allocation and character copying) just to pass the desired parameter. Using the macro ensures this consistent set of overloads for every wide-string conversion function. Additionally, knowing that the ugly-name overloads exist, ll_convert_forms() implicitly defines corresponding ll_convert<TARGET>() overloads. Streamline declarations of utf16str_to_wstring(), wstring_to_utf16str(), utf8str_to_utf16str(), utf16str_to_utf8str(), utf8str_to_wstring(), wstring_to_utf8str(), ll_convert_wide_to_wstring() and ll_convert_wstring_to_wide() using ll_convert_forms(). Use corresponding new ll_convert_cp_forms() macro to declare consistent overloads for conversion functions accepting an optional unsigned int code_page parameter. We used to delegate to the .cpp file the implementation of each overload accepting code_page so llstring.h need not include the Windows header defining the CP_UTF8 default; this is more simply accomplished by introducing a small ll_wstring_default_code_page() function to retrieve it from the .cpp file. That lets us specify the code_page parameter as optional, using that function as its default value. Use ll_convert_cp_forms() to streamline declarations of ll_convert_wide_to_string() and ll_convert_string_to_wide(). Introduce real implementations of ll_convert_wide_to_wstring() and ll_convert_wstring_to_wide(). The previous implementations merely copied individual characters, which is wrong: when we convert UTF16LE to UTF32, we can and should fold multi-character UTF16LE encodings to the corresponding single UTF32 character. The real implemenations leverage our awareness that both llutf16string and Windows std::wstring (either variant) use UTF16LE encoding, so we can reuse the corresponding llutf16string conversions. Introduce generic ll_convert_length() function, specialized as either std::strlen() or std::wcslen() depending on parameter type. (Even if std::wcslen() is derived from classic C, why doesn't the C++ standard library define a std::strlen(const wchar_t*) overload to call it?) Fix ll_convert_alias()'s ll_convert_impl specialization's operator() to accept boost::call_traits::param_type, so we can pass (e.g.) const std::wstring& but also const wchar_t* instead of const wchar_t*&.
2021-11-01SL-16237 FIXED Viewer hangs on loginMnikolenko Productengine
2021-10-28SL-16148 SL-16244 SL-16270 SL-16253 Remove most BlockTimers, remove ↵Dave Parks
LLMemTracked, introduce alignas, hook most/all reamining allocs, disable synchronous occlusion, and convert frequently accessed LLSingletons to LLSimpleton