summaryrefslogtreecommitdiff
path: root/indra/llrender/llgl.cpp
AgeCommit message (Collapse)Author
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-01-14- add static construslantproductengine
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-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).
2017-10-11Automated merge with ssh://bitbucket.org/lindenlab/viewer-releaseNat Goodspeed
2017-08-30MAINT-7758 Fixed freeze on loading lsl scripts from unicode named windows ↵andreykproductengine
folder.
2016-11-11MAINT-6913 - (Via Sovereign Engineer and Shyotl Kuhr) Pack the skinned ↵Brad Payne (Vir Linden)
matrix and translation into a single mat3x4 for optimal data transfer to reduce uniform slot usage.
2016-12-20move debugging globals to the "lowest" library they are referenced inOz Linden
2015-11-10remove execute permission from many files that should not have itOz Linden
2014-05-13sunshine-external merge WIPBrad Payne (Vir Linden)
2013-10-16mergeBrad Payne (Vir Linden)
2013-10-08merge from viewer-releaseRichard Linden
2013-10-01Automated merge with http://bitbucket.org/lindenlab/viewer-releaseRichard Linden
2013-09-18The unbearable lightness of being norspecGraham Linden
2013-08-22mergeBrad Payne (Vir Linden)
2013-08-19MergeXiaohong Bao
2013-08-19Merge in viewer-releaseGraham Linden
2013-08-16merge with viewer-releaseNyx Linden
2013-08-09second phase summer cleaningRichard Linden
replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc.
2013-07-23NORSPEC-314 WIP make work-around easier to flip and add 9800M as an evil macGraham Linden
2013-06-21Automated merge with file:///F:%5Cviewer-bearDave Parks
2013-06-20Automated merge with http://bitbucket.org/lindenlab/viewer-releaseDave Parks
2013-05-21mergeBrad Payne (Vir Linden)
2013-05-09Merge downstream code and viewer-betasimon
2013-05-09Merge viewer-betasimon
2013-05-01NORSPEC-144 make code to nerf use of FBOs on old windows drivers not affect ↵Graham Madarasz (Graham)
Mac too
2013-04-25Merge 3.5.1 into MaterialsGraham Madarasz
2013-04-19merge changes for DRTVWR-294Oz Linden
2013-04-15NORSPEC-49 Add shader profiler, add support for ARB_depth_clamp where availableDave Parks
2013-04-11Forgot to commit @#! mergesimon
2013-04-11Merge in downstream code (chui fixes, materials)simon
2013-04-11Mergesimon
2013-04-09NORSPEC-59 work around nV driver crash when doing deferred rendering on NV ↵Graham Madarasz
9400M/9600M
2013-04-01merge changes for 3.5.0-beta7Oz Linden
2013-03-29Update Mac and Windows breakpad builds to latestGraham Madarasz
2013-03-28Merged lindenlab/viewer-development into defaultgraham linden
2013-03-25Pull in downstream CHUI code from viewer-developmentsimon
2013-03-22Pull and merge latest viewer-betasimon
2013-03-21Folded in changes from sunshine-stableprep
2013-03-20Merge with viewer-chuiprep@lindenlab.com
2013-03-16CHUI-863 : Clean up dead code that's creating failures on gcc-4.6 builds on ↵merov
Linux
2013-03-13More fixes for gcc-4.6 breakageDon Kjer
2013-03-13Merging LLCURL::Responder changes with CHUI changes. Fixed gcc 4.6 compile ↵Don Kjer
failures
2013-03-04MAINT-2371 More optimizations.Dave Parks
Reviewed by Graham
2013-02-26MAINT-2371 First set of profile guided optimizations.Dave Parks
Reviewed by Graham
2013-02-12merge up to 3.4.5-releaseOz Linden
2013-02-07For MAINT-1291 Code Review: DavePGraham Madarasz
2013-01-24merging in viewer-beta.Nyx Linden
Most of the merge was clean, a couple conflicts. Brought over a couple patches manually for llpolymesh.
2012-12-18MAINT-2150 Fix for super-large ( > 4096 ) snapshots having black bordersDave Parks