Commit Graph

45154 Commits (fdc0257acbde5a2d5bb201efcc8bb723df09daf8)

Author SHA1 Message Date
Nat Goodspeed fdc0257acb DRTVWR-564: Fix LLEventDispatcher::addMethod() for LazyEventAPI.
A classic LLEventAPI subclass calls LLEventDispatcher::add() methods in its
own constructor. At that point, addMethod() can reliably dynamic_cast its
'this' pointer to the new subclass.

But because of the way LazyEventAPI queues up add() calls, they're invoked in
the (new) LLEventAPI constructor itself. The subclass constructor body hasn't
even started running, and LLEventDispatcher::addMethod()'s dynamic_cast to the
LLEventAPI subclass returns nullptr. addMethod() claims the new subclass isn't
derived from LLEventDispatcher, which is confusing since it is.

It works to change addMethod()'s dynamic_cast to static_cast.

Flesh out lazyeventapi_test.cpp. post() maps with "op" keys to actually try to
engage the registered operation. Give the operation an observable side effect;
use ensure_mumble() to verify. Also verify that LazyEventAPI has captured the
subject LLEventAPI's metadata in a way we can retrieve.
2022-06-21 15:23:29 -04:00
Nat Goodspeed 490de3ab6e DRTVWR-564: We don't need LLEventAPI to befriend LazyEventAPI. 2022-06-21 14:46:59 -04:00
Nat Goodspeed af4fbc1f8a DRTVWR-564: WIP: Add LazyEventAPI and tests. Tests don't yet pass.
LazyEventAPI is a registrar that implicitly instantiates some particular
LLEventAPI subclass on demand: that is, when LLEventPumps::obtain() tries to
find an LLEventPump by the registered name.

This leverages the new LLEventPumps::registerPumpFactory() machinery. Fix
registerPumpFactory() to adapt the passed PumpFactory to accept TypeFactory
parameters (two of which it ignores). Supplement it with
unregisterPumpFactory() to support LazyEventAPI instances with lifespans
shorter than the process -- which may be mostly test programs, but still a
hole worth closing. Similarly, add unregisterTypeFactory().

A LazyEventAPI subclass takes over responsibility for specifying the
LLEventAPI's name, desc, field, plus whatever add() calls will be needed to
register the LLEventAPI's operations. This is so we can (later) enhance
LLLeapListener to consult LazyEventAPI instances for not-yet-instantiated
LLEventAPI metadata, as well as enumerating existing LLEventAPI instances.

The trickiest part of this is capturing calls to the various
LLEventDispatcher::add() overloads in such a way that, when the LLEventAPI
subclass is eventually instantiated, we can replay them in the new instance.

LLEventAPI acquires a new protected constructor specifically for use by a
subclass registered by a companion LazyEventAPI. It accepts a const reference
to LazyEventAPIParams, intended to be opaque to the LLEventAPI subclass; the
subclass must declare a constructor that accepts and forwards the parameter
block to the new LLEventAPI constructor. The implementation delegates to the
existing LLEventAPI constructor, plus it runs deferred add() calls.

LLDispatchListener now derives from LLEventStream instead of containing it as
a data member. The reason is that if LLEventPumps::obtain() implicitly
instantiates it, LLEventPumps's destructor will try to destroy it by deleting
the LLEventPump*. If the LLEventPump returned by the factory function is a
data member of an outer class, that won't work so well. But if
LLDispatchListener (and by implication, LLEventAPI and any subclass) is
derived from LLEventPump, then the virtual destructor will Do The Right Thing.

Change LLDispatchListener to *not* allow tweaking the LLEventPump name. Since
the overwhelming use case for LLDispatchListener is LLEventAPI, accepting but
silently renaming an LLEventAPI subclass would ensure nobody could reach it.

Change LLEventDispatcher's use of std::enable_if to control the set of add()
overloads available for the intended use cases. Apparently this formulation is
just as functional at the method declaration point, while avoiding the need to
restate the whole enable_if expression at the method definition point.

Add lazyeventapi_test.cpp to exercise.
2022-06-18 11:57:10 -04:00
Nat Goodspeed dc2e2cd76f DRTVWR-564: Add LL::apply(): call function, passing args from tuple.
This anticipates C++17's std::apply(), and in fact once we detect C++17, we'll
just use that. But in C++14 we must still provide our own implementation.
2022-06-18 11:53:57 -04:00
Nat Goodspeed c7408f842e DRTVWR-564: Merge branch 'pick-eventapi' into lazy-eventpump
to pick up generalized LLEventAPI add() methods and softer error handling.
2022-06-15 20:05:36 -04:00
Nat Goodspeed 4e7b4bab79 DRTVWR-558: Generalize LLEventDispatcher::add() constraints.
Instead of checking whether an add() parameter is exactly LLSD or LLSDMap,
check whether it's convertible to LLSD -- which handles those cases and more.

(cherry picked from commit fa168c11f64771dadc5df86d14ca2f07eba3b8ba)
2022-06-15 20:04:34 -04:00
Nat Goodspeed f134eace91 DRTVWR-558: LLEventAPI allows all LLEventDispatcher add() overloads.
Previously, LLEventAPI intentionally hid all but one of the many add()
overloads supported by its LLEventDispatcher base class. The reason was that
certain of the add() methods take an optional fourth parameter that's an
LLSD::Map describing the expected parameter structure, while others take a
fourth templated parameter that's an instance getter callable. This led to
ambiguity, especially when passed an LLSDMap instance that's convertible to
LLSD but isn't literally LLSD. At the time, it was simpler to constrain the
add() methods inherited from LLEventDispatcher.

But by adding new std::enable_if constraints to certain LLEventDispatcher
add() methods, we've resolved the ambiguities, so LLEventAPI subclasses can
now use any add() overload (as claimed on the relevant Confluence page).

LLEventDispatcher comments have always loftily claimed that an instance getter
callable may return either a pointer or a reference, doesn't matter. But it
does when trying to pass the getter's result to boost::fusion::push_back(): a
reference must be wrapped with std::ref() while a pointer cannot be.
std::ref(pointer) produces errors. Introduce LLEventDispatcher::invoker::
bindable() overloads to Do The Right Thing whether passed a pointer or a
reference.

(cherry picked from commit 743f487c2e123171c9fc6d5b84d768f1d856d569)
2022-06-15 20:04:34 -04:00
Nat Goodspeed b26e516d2b DRTVWR-558: Change LLEventDispatcher error action (also LLEventAPI).
Originally the LLEventAPI mechanism was primarily used for VITA testing. In
that case it was okay for the viewer to crash with LL_ERRS if the test script
passed a bad request.

With puppetry, hopefully new LEAP scripts will be written to engage
LLEventAPIs in all sorts of interesting ways. Change error handling from
LL_ERRS to LL_WARNS. Furthermore, if the incoming request contains a "reply"
key, send back an error response to the requester.

Update lleventdispatcher_test.cpp accordingly.

(cherry picked from commit de0539fcbe815ceec2041ecc9981e3adf59f2806)
2022-06-15 20:04:34 -04:00
Nat Goodspeed a4ff9caf69 DRTVWR-564: WIP: add LLEventPumps::registerPumpFactory()
and registerTypeFactory().

Untested.

This will support registering just-in-time LLEventAPI instances, instantiated
on demand.
2022-06-15 19:43:53 -04:00
Nat Goodspeed cdbd06e8ed Increment viewer version to 6.6.1
following promotion of DRTVWR-546
2022-05-25 19:22:09 -04:00
Dave Parks 3365a39080 SL-17451 Fix for erroneous attempt to apply vertex color alpha to texture before alpha masking (we don't actually support this and the vertex color alpha is sometimes zero when you think it ought not be). 2022-05-19 14:02:48 -05:00
Dave Parks bf183ecff7 SL-17449 Fix for Alexa's hair 2022-05-18 17:56:54 -05:00
Dave Parks c1deab5ba7 SL-17417 Fix for incorrect reflection orientation on fullbright prims. 2022-05-18 15:55:24 -05:00
Dave Parks a936322261 Merge branch 'DRTVWR-546' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-546 2022-05-17 13:23:32 -05:00
Dave Parks 85b3f707d3 SL-17421 Fix for fullbright alpha mask shader ignoring vertex alpha 2022-05-17 13:23:08 -05:00
Andrey Kleshchev c6fe446c3a SL-17415 Movement of scripted attached objects is no longer interpolated. 2022-05-17 00:15:32 +03:00
Dave Parks c7ddba7eb4 SL-17417 Fix for incorrect reflection orientation on some moving child prims. 2022-05-16 16:02:38 -05:00
Andrey Lihatskiy 6309500557 SL-17356 Viewer changes for Premium Plus support 2022-05-11 21:05:46 +03:00
Andrey Kleshchev f0fa74fde7 SL-17376 Do not fail build if vcruntime140_1 is missing
If there is no vcruntime140_1 in the build system, it is likely that file is not required for the viewer to run.
2022-05-10 18:53:33 +03:00
Andrey Kleshchev c0adc5e181 SL-17376 Fix viewer failing due to missing vcruntime140_1 2022-05-09 21:22:22 +03:00
Andrey Kleshchev ca24fc11ea SL-17375 Crash at LLViewerOctreeEntry::getSpatialExtents()
access violation, 'this' was null
2022-05-06 20:55:41 +03:00
Andrey Kleshchev 43517c5adc SL-17244 Fix 'empty leaf' crashes 2022-05-05 19:41:56 +03:00
Andrey Kleshchev f3add82a4c Merge branch master (D550) into DRTVWR-546
# Conflicts:
#	indra/newview/llappviewer.h
2022-05-04 20:10:29 +03:00
Nat Goodspeed bc7e2fb7e7 Increment viewer version to 6.5.6
following promotion of DRTVWR-550
2022-05-04 11:37:24 -04:00
Dave Parks 1a6eee4ea2 SL-17321 Fix for some particle systems with custom blend functions not rendering. 2022-05-02 11:52:45 -05:00
Andrey Kleshchev da6f4204b7 SL-17124 make sure window thread wakes up to proces 'quit' message 2022-04-29 22:18:20 +03:00
Andrey Kleshchev 904b16a0a7 SL-17124 switchContext and loadShaderFile crashes
- Do not try initializing shaders if requirements are not met or if window does not exist
- Warn user before closing window. Situation is unexpected, there is chance of more issues, like a freeze or a crash on close()
- mHasMultitexture is a solid requirement, if it is not present, we won't be able to run
2022-04-29 19:41:22 +03:00
Andrey Kleshchev ac0c9a7412 SL-16721 Crash at LLVOAvatar::idleUpdateMisc 2022-04-28 23:06:56 +03:00
Mnikolenko Productengine 9c0ebc5469 SL-17301 FIXED Friends are not showing in friendslist 2022-04-28 11:39:58 +03:00
Dave Parks a00a569ac8 SL-17276 Potential fix for crash on shutdown on mac. 2022-04-26 16:38:47 -05:00
Dave Parks 436544a51a SL-17086 Fix for bad lighting in upload preview render. 2022-04-26 14:43:55 -05:00
Dave Parks bafa869c21 SL-17239 Override face bounding box with avatar bounding box for rigged meshes when calculating virtual size. 2022-04-25 15:58:07 -05:00
Brad Kittenbrink 56a1bc850b SL-17223 fix unit tests with new method stub implementation 2022-04-25 13:44:38 -07:00
Dave Parks 55179387c7 SL-17236 For real this time, maintain legacy draw order of alpha rigged meshes, batching be damned. 2022-04-25 15:27:39 -05:00
Brad Kittenbrink 372a04dd51 Fix for SL-17223 save mfa_hash protected store immediately so it doesn't get lost in case of crash 2022-04-25 12:35:07 -07:00
Andrey Kleshchev ffdc04f5d2 SL-17040 Crash due to LLWord not existing
LLWord should persist till the end due to wide usage.
2022-04-21 22:58:30 +03:00
Andrey Kleshchev cf7bc4406e SL-17159 Crash initializing LLInstanceTrackerPrivate 2022-04-21 20:43:50 +03:00
Andrey Kleshchev e0c4304e4a Restored SL-15400, it got lost in an automatic merge
Pausing clouds should not pause water
2022-04-19 21:15:58 +03:00
Andrey Kleshchev ce4c694b66 Merge branch master (D540) into DRTVWR-546
# Conflicts:
#	indra/llcommon/llsdutil.cpp
#	indra/newview/VIEWER_VERSION.txt
#	indra/newview/lldrawpoolalpha.cpp
#	indra/newview/lldrawpoolwater.cpp
2022-04-18 23:42:39 +03:00
Brad Kittenbrink e9921e77b0 Merge remote-tracking branch 'origin/master' into DRTVWR-550-mfa 2022-04-18 13:29:25 -07:00
Nat Goodspeed d031662435 Increment viewer version to 6.5.5
following promotion of DRTVWR-540
2022-04-18 13:25:21 -04:00
Andrey Kleshchev efb9df04c3 SL-16831 Don't wait for an updater on login failure unles it's the cause of failure 2022-04-15 20:53:21 +03:00
Dave Parks e33f23f58a SL-17194 Impostor quality pass 2 (and fix for fully transparent rigged attachments rendering to depth buffer) 2022-04-11 20:06:33 -05:00
Dave Parks cb6e1ac4a8 Merge branch 'DRTVWR-546' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-546 2022-04-11 15:52:11 -05:00
Dave Parks 1d057dbba2 SL-17173 Impostor quality pass. 2022-04-11 15:51:51 -05:00
Mnikolenko Productengine d248961c30 SL-17182 FIXED Viewer crashes after changing the environment settings 2022-04-11 17:51:10 +03:00
Andrey Kleshchev e20aafa2fe SL-16907 Crash at updateSkinInfoMatrixPalette #2 2022-04-07 14:17:30 +03:00
Andrey Kleshchev 7e0e58c55f SL-17092 Fix a gesture upload crash 2022-04-07 11:11:39 +03:00
Dave Parks bc7dc2f949 SL-17160 Ignore "getIsAlphaMask" on rigged faces. 2022-04-06 12:57:07 -05:00
Andrey Lihatskiy 1497177868 Merge remote-tracking branch 'origin/SL-16950' into DRTVWR-540-maint 2022-04-05 18:01:45 +03:00