summaryrefslogtreecommitdiff
path: root/indra/llrender
AgeCommit message (Collapse)Author
2020-03-25DRTVWR-476: Fix glVertexAttrib{IPointer,PointerARB}() OpenGL calls.Nat Goodspeed
VS 2017 complains about the same thing that clang does: casting S32 to GLvoid* can't possibly produce a valid pointer value because S32 can't fit a whole 64-bit pointer. To appease it, not only must we use reinterpret_cast, but we must first cast S32 to intptr_t and then reinterpret_cast THAT.
2020-03-25DRTVWR-494: Defend LLInstanceTracker against multi-thread usage.Nat Goodspeed
The previous implementation went to some effort to crash if anyone attempted to create or destroy an LLInstanceTracker subclass instance during traversal. That restriction is manageable within a single thread, but becomes unworkable if it's possible that a given subclass might be used on more than one thread. Remove LLInstanceTracker::instance_iter, beginInstances(), endInstances(), also key_iter, beginKeys() and endKeys(). Instead, introduce key_snapshot() and instance_snapshot(), the only means of iterating over LLInstanceTracker instances. (These are intended to resemble functions, but in fact the current implementation simply presents the classes.) Iterating over a captured snapshot defends against container modifications during traversal. The term 'snapshot' reminds the coder that a new instance created during traversal will not be considered. To defend against instance deletion during traversal, a snapshot stores std::weak_ptrs which it lazily dereferences, skipping on the fly any that have expired. Dereferencing instance_snapshot::iterator gets you a reference rather than a pointer. Because some use cases want to delete all existing instances, add an instance_snapshot::deleteAll() method that extracts the pointer. Those cases used to require explicitly copying instance pointers into a separate container; instance_snapshot() now takes care of that. It remains the caller's responsibility to ensure that all instances of that LLInstanceTracker subclass were allocated on the heap. Replace unkeyed static LLInstanceTracker::getInstance(T*) -- which returned nullptr if that instance had been destroyed -- with new getWeak() method returning std::weak_ptr<T>. Caller must detect expiration of that weak_ptr. Adjust tests accordingly. Use of std::weak_ptr to detect expired instances requires engaging std::shared_ptr in the constructor. We now store shared_ptrs in the static containers (std::map for keyed, std::set for unkeyed). Make LLInstanceTrackerBase a template parameterized on the type of the static data it manages. For that reason, hoist static data class declarations out of the class definitions to an LLInstanceTrackerStuff namespace. Remove the static atomic sIterationNestDepth and its methods incrementDepth(), decrementDepth() and getDepth(), since they were used only to forbid creation and destruction during traversal. Add a std::mutex to static data. Introduce an internal LockStatic class that locks the mutex while providing a pointer to static data, making that the only way to access the static data. The LLINSTANCETRACKER_DTOR_NOEXCEPT macro goes away because we no longer expect ~LLInstanceTracker() to throw an exception in test programs. That affects LLTrace::StatBase as well as LLInstanceTracker itself. Adapt consumers to the new LLInstanceTracker API.
2019-11-12Fix instance existance checkandreykproductengine
2019-09-10Merged in lindenlab/viewer-releaseandreykproductengine
2019-08-13SL-11718 Crash in LLRender2Dandreykproductengine
2019-08-12DRTVWR-493: Streamline LLParamSingleton, LLLockedSingleton.Nat Goodspeed
Simplify LLSingleton::SingletonLifetimeManager to SingletonInitializer: that struct has not been responsible for deletion ever since LLSingletonBase acquired dependency-ordered deleteAll(). Move SingletonData::mInitState changes from SingletonLifetimeManager to constructSingleton() method. Similarly, constructSingleton() now sets SingletonData::mInstance instead of making its caller store the pointer. Add variadic arguments to LLSingleton::constructSingleton() so we can reuse it for LLParamSingleton. Add finishInitializing() method to encapsulate logic reused for getInstance()'s INITIALIZING and DELETED cases. Make LLParamSingleton a subclass of LLSingleton, just as LLLockedSingleton is a subclass of LLParamSingleton. Make LLParamSingleton a friend of LLSingleton, so it can access private members of LLSingleton without also granting access to any DERIVED_CLASS subclass. This eliminates the need for protected getInitState(). LLParamSingleton::initParamSingleton() reuses LLSingleton::constructSingleton() and finishInitializing(). Its getInstance() method completely replaces LLSingleton::getInstance(): in most EInitStates, LLParamSingleton::getInstance() is an error. Use a std::mutex to serialize calls to LLParamSingleton::initParamSingleton() and getInstance(). While LLSingleton::getInstance() relies on the "initialized exactly once" guarantee for block-scope static declarations, LLParamSingleton cannot rely on the same mechanism. LLLockedSingleton is now a very succinct subclass of LLParamSingleton -- they have very similar functionality. Giving the LLSINGLETON() macro variadic arguments eliminates the need for a separate LLPARAMSINGLETON() macro, while continuing to support existing usage.
2019-08-11DRTVWR-493 tiny optimizationandreykproductengine
2019-08-10DRTVWR-493 LLRender2D init cleanupandreykproductengine
2019-07-25DRTVWR-493 LLRender2D to LLParamSingletonandreykproductengine
2019-03-01Merged in lindenlab/viewer-releaseAndreyL ProductEngine
2019-01-14- add static construslantproductengine
2018-12-17SL-10252: On Windows, use $SystemRoot again, not FOLDERID_Fonts.Nat Goodspeed
2018-12-15SL-10153: auto name{expression} declares an initializer_listNat Goodspeed
instead of a variable of type decltype(expression). Using SHGetKnownFolderPath(FOLDERID_Fonts) in LLFontGL::getFontPathSystem() requires new Windows #include files. A variable with a constructor can't be declared within the braces of a switch statement, even outside any of its case clauses.
2018-12-14SL-10153: Review and rationalize fetching paths from environment.Nat Goodspeed
Use LLStringUtil::getenv() or getoptenv() whenever we fetch a string that will be used as a pathname. Use LLFile::tmpdir() instead of getenv("TEMP"). As an added extra-special bonus, finally clean up $TMP/llcontrol-test-zzzzzz directories that have been accumulating every time we run a local build!
2018-09-27Merged in lindenlab/viewer-releaseAndreyL ProductEngine
2019-05-13SL-11139 FIXED LLFontGL::getStringFromStyle() never return "NORMAL"maxim_productengine
2019-04-02Merged in lindenlab/viewer-bearAndreyL ProductEngine
2019-03-19SL-10610 FIXED Floaters fails to display certain symbols. Added ability to ↵maxim_productengine
load font collections.
2019-03-13SL-10610 mac fix for showing special charactersMnikolenko ProductEngine
2018-08-16MAINT-3699 new shaders supporting alpha blend/mask rigged content.Graham Linden
Make shader loading debug logging of uniforms use ShaderUniform to make supression simpler.
2018-08-02Merged in lindenlab/viewer-releaseAndreyL ProductEngine
2018-07-26MAINT-8923 Better allocation failure handling, createGLTexture crashesandreykproductengine
2018-07-04Fixed line endings in llgl.cppAndreyL ProductEngine
2018-07-02MAINT-7548 MAINT-7560 use NvidiaOptimusEnablement globally exported var to ↵Graham Linden
signal desire to use high-performance graphics processor
2018-05-18Merged in lindenlab/viewer-releaseAndreyL ProductEngine
2018-06-04MAINT-8686 Mode detailed VBO crash loggingandreykproductengine
2018-03-02Merged in lindenlab/viewer-releaseAndreyL ProductEngine
2018-03-06MAINT-6363 Normal and specular maps should not be downloaded if ALM is offAndrey Kleshchev
2018-02-27MAINT-8317 Fixed Local Textures for Advanced Lighting Projectors do not keep ↵andreykproductengine
the selected texture.
2018-02-15Add debug setting and code to allow nVidia nSight graphics debugging to ↵Graham Linden graham@lindenlab.com
capture SL frames. These changes are only enabled if RenderNsightDebugSupport is true and eliminate use of some OpenGL legacy functionality which is incompatible with nSight capture (mostly glReadPixels and other fixed-function pipe rendering calls).
2018-02-13MAINT-8146 Clearing pointersandreykproductengine
2018-02-12MAINT-8146 Remade fix with streams to save memoryandreykproductengine
2018-01-30Add construslantproductengine
2018-01-30Keep attributes name (useful for debug)ruslantproductengine
2018-01-30MAINT-8091 Removed deprecated and unused private memory poolingAndrey Kleshchev
2018-01-17Merged in lindenlab/viewer-bearAndreyL ProductEngine
2018-01-17Merged in lindenlab/viewer-releaseAndreyL ProductEngine
2018-01-12MAINT-7003 Crash in LLVBOPoolandreykproductengine
Error to help figuring out if error happens due to gl or memory issue
2017-12-18MAINT-8043 Fix for bad_alloc crash in LLImageGL::setImage()AndreyL ProductEngine
2017-12-18MAINT-8101 Added sanity check to confirm crash locationandreykproductengine
2017-11-29DRTVWR-418: Merge from latest viewer-releaseNat Goodspeed
2018-01-09MAINT-8146 Fixed Installing viewer to non default path results in incorrect ↵andreykproductengine
fonts loading
2017-11-16MAINT-7228 Vertex buffer allocation failure handlingandreykproductengine
2017-12-26MAINT-6437 - Tile-Based Texture Animation Scales Incorrectly for Rigged Mesh ↵ruslantproductengine
when worn (MacOS only) FIXED.
2017-11-03MAINT-7228 Substituted assert with errorandreykproductengine
2017-11-01MAINT-7228 Vertex buffer allocation failure handlingandreykproductengine
2017-10-26MAINT-7213 Shared media (media as a texture) unusable with transparent meshruslantproductengine
New outline selection around mesh objects.
2017-11-22Merged in lindenlab/viewer-lynxAndreyL ProductEngine
2017-11-17MAINT-72 unmapBuffer crashandreykproductengine
2017-10-11Automated merge with ssh://bitbucket.org/lindenlab/viewer-releaseNat Goodspeed