root/OpenSceneGraph/trunk/include/osgDB/DatabasePager @ 10174

Revision 10174, 26.4 kB (checked in by robert, 6 years ago)

Moved Registry::ReadFileCallback? + WriteFileCallback?, and osgDB::ReaderWriter::Options into their own separate Options file and into the osgDB namespace.

Introduced a new callback osgDB::FindFileCallback? that overrides the default behavior of findDataFile/findLibraryFile.

Introduced support for assigning ReaderWriter::Options directory to PagedLOD.

Introduced new osgDB::FileLocationCallback? for assistancing the DatabasePager? to know when a file is hosted on a local or remote file system.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under 
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGDB_DATABASEPAGER
15#define OSGDB_DATABASEPAGER 1
16
17#include <osg/NodeVisitor>
18#include <osg/Group>
19#include <osg/PagedLOD>
20#include <osg/Drawable>
21#include <osg/GraphicsThread>
22#include <osg/FrameStamp>
23
24#include <OpenThreads/Thread>
25#include <OpenThreads/Mutex>
26#include <OpenThreads/ScopedLock>
27#include <OpenThreads/Condition>
28
29#include <osgDB/SharedStateManager>
30#include <osgDB/ReaderWriter>
31#include <osgDB/Options>
32
33#include <map>
34#include <list>
35#include <algorithm>
36#include <functional>
37
38namespace osgDB {
39
40
41
42/** Database paging class which manages the loading of files in a background thread,
43  * and synchronizing of loaded models with the main scene graph.*/
44class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandler
45{
46    public :
47
48        typedef OpenThreads::Thread::ThreadPriority ThreadPriority;
49
50        DatabasePager();
51
52        DatabasePager(const DatabasePager& rhs);
53       
54        /** Create a shallow copy on the DatabasePager.*/
55        virtual DatabasePager* clone() const { return new DatabasePager(*this); }
56
57        /** get the prototype singleton used by DatabasePager::create().*/
58        static osg::ref_ptr<DatabasePager>& prototype();
59       
60        /** create a DatabasePager by cloning DatabasePager::prototype().*/
61        static DatabasePager* create();
62
63       
64
65        /** Add a request to load a node file to end the the database request list.*/
66        virtual void requestNodeFile(const std::string& fileName,osg::Group* group,
67                                     float priority, const osg::FrameStamp* framestamp,
68                                     osg::ref_ptr<osg::Referenced>& databaseRequest,
69                                     const osg::Referenced* options);
70
71        /** Set the priority of the database pager thread(s).*/
72        int setSchedulePriority(OpenThreads::Thread::ThreadPriority priority);
73
74        /** Cancel the database pager thread(s).*/       
75        virtual int cancel();
76       
77        virtual bool isRunning() const;
78       
79        /** Clear all internally cached structures.*/
80        virtual void clear();
81       
82        class OSGDB_EXPORT DatabaseThread : public osg::Referenced, public OpenThreads::Thread
83        {
84        public:
85       
86            enum Mode
87            {
88                HANDLE_ALL_REQUESTS,
89                HANDLE_NON_HTTP,
90                HANDLE_ONLY_HTTP
91            };
92       
93            DatabaseThread(DatabasePager* pager, Mode mode, const std::string& name);
94           
95            DatabaseThread(const DatabaseThread& dt, DatabasePager* pager);
96           
97            void setDone(bool done) { _done = done; }
98            bool getDone() const { return _done; }
99           
100            void setActive(bool active) { _active = active; }
101            bool getActive() const { return _active; }
102
103            virtual int cancel();
104           
105            virtual void run();
106           
107        protected:
108
109            virtual ~DatabaseThread();
110       
111            bool            _done;
112            bool            _active;
113            DatabasePager*  _pager;
114            Mode            _mode;
115            std::string     _name;
116        };
117       
118        void setUpThreads(unsigned int totalNumThreads=2, unsigned int numHttpThreads=1);
119
120        unsigned int addDatabaseThread(DatabaseThread::Mode mode, const std::string& name);
121
122        DatabaseThread* getDatabaseThread(unsigned int i) { return _databaseThreads[i].get(); }
123       
124        const DatabaseThread* getDatabaseThread(unsigned int i) const { return _databaseThreads[i].get(); }
125
126        unsigned int getNumDatabaseThreads() const { return _databaseThreads.size(); }
127       
128        /** Set whether the database pager thread should be paused or not.*/
129        void setDatabasePagerThreadPause(bool pause);
130       
131        /** Get whether the database pager thread should is paused or not.*/
132        bool getDatabasePagerThreadPause() const { return _databasePagerThreadPaused; }
133       
134        /** Set whether new database request calls are accepted or ignored.*/
135        void setAcceptNewDatabaseRequests(bool acceptNewRequests) { _acceptNewRequests = acceptNewRequests; }
136       
137        /** Get whether new database request calls are accepted or ignored.*/
138        bool getAcceptNewDatabaseRequests() const { return _acceptNewRequests; }
139       
140        /** Get the number of frames that are currently active.*/
141        int getNumFramesActive() const { return _numFramesActive; }
142
143        /** Signal the database thread that the update, cull and draw has begun for a new frame.
144          * Note, this is called by the application so that the database pager can go to sleep while the CPU is busy on the main rendering threads. */
145        virtual void signalBeginFrame(const osg::FrameStamp* framestamp);
146       
147        /** Signal the database thread that the update, cull and draw dispatch has completed.
148          * Note, this is called by the application so that the database pager can go to wake back up now the main rendering threads are iddle waiting for the next frame.*/
149        virtual void signalEndFrame();
150       
151
152        /** Find all PagedLOD nodes in a subgraph and register them with
153          * the DatabasePager so it can keep track of expired nodes.
154          * note, should be only be called from the update thread. */
155        virtual void registerPagedLODs(osg::Node* subgraph, int frameNumber = 0);
156
157        /** Set whether the database pager should pre compile OpenGL objects before allowing
158          * them to be merged into the scene graph.
159          * Pre compilation helps reduce the chances of frame drops, but also slows the
160          * speed at which tiles are merged as they have to be compiled first.*/
161        void setDoPreCompile(bool flag) { _doPreCompile = flag; }
162
163        /** Get whether the database pager should pre compile OpenGL objects before allowing
164          * them to be merged into the scene graph.*/
165        bool getDoPreCompile() const { return _doPreCompile; }
166
167
168        /** Set the target frame rate that the DatabasePager should assume.
169          * Typically one would set this to the value refresh rate of your display system i.e. 60Hz.
170          * Default value is 100.
171          * Usage notes.  The TargetFrameRate and the MinimumTimeAvailableForGLCompileAndDeletePerFrame
172          * parameters are not directly used by DatabasePager, but are should be used as a guide for how
173          * long to set aside per frame for compiling and deleting OpenGL objects - ie. the value to use
174          * when calling DatabasePager::compileGLObjectgs(state,availableTime,). The longer amount of
175          * time to set aside  cthe faster databases will be paged in but with increased chance of frame drops,
176          * the lower the amount of time the set aside the slower databases will paged it but with better
177          * chance of avoid any frame drops.  The default values are chosen to achieve the later when running
178          * on a modern mid to high end  PC.
179          * The way to compute the amount of available time use a scheme such as :
180          *    availableTime = maximum(1.0/targetFrameRate - timeTakenDuringUpdateCullAndDraw, minimumTimeAvailableForGLCompileAndDeletePerFrame).
181          */
182        void setTargetFrameRate(double tfr) { _targetFrameRate = tfr; }
183
184        /** Get the target frame rate that the DatabasePager should assume.*/
185        double getTargetFrameRate() const { return _targetFrameRate; }
186       
187        /** Set the minimum amount of time (in seconds) that should be made available for compiling and delete OpenGL objects per frame.
188          * Default value is 0.001 (1 millisecond).
189          * For usage see notes in setTargetFrameRate.*/
190        void setMinimumTimeAvailableForGLCompileAndDeletePerFrame(double ta) { _minimumTimeAvailableForGLCompileAndDeletePerFrame = ta; }
191
192        /** Get the minimum amount of time that should be made available for compiling and delete OpenGL objects per frame.
193          * For usage see notes in setTargetFrameRate.*/
194        double getMinimumTimeAvailableForGLCompileAndDeletePerFrame() const { return _minimumTimeAvailableForGLCompileAndDeletePerFrame; }
195
196        /** Set the maximum number of OpenGL objects that the page should attempt to compile per frame.
197          * Note, Lower values reduces chances of a frame drop but lower the rate that database will be paged in at.
198          * Default value is 8. */
199        void setMaximumNumOfObjectsToCompilePerFrame(unsigned int num) { _maximumNumOfObjectsToCompilePerFrame = num; }
200
201        /** Get the maximum number of OpenGL objects that the page should attempt to compile per frame.*/
202        unsigned int getMaximumNumOfObjectsToCompilePerFrame() const { return _maximumNumOfObjectsToCompilePerFrame; }
203
204
205        /** Set the target maximum number of PagedLOD to maintain in memory.
206          * Note, if more than the target number are required for rendering of a frame then these active PagedLOD are excempt from being expiried.
207          * But once the number of active drops back below the target the inactive PagedLOD will be trimmed back to the target number.*/
208        void setTargetMaximumNumberOfPageLOD(unsigned int target) { _targetMaximumNumberOfPageLOD = target; }
209
210        /** Get the target maximum number of PagedLOD to maintain in memory.*/
211        unsigned int getTargetMaximumNumberOfPageLOD() const { return _targetMaximumNumberOfPageLOD; }
212
213
214        /** Deprecated.*/
215        void setExpiryDelay(double expiryDelay) { _expiryDelay = expiryDelay; }
216       
217        /** Deprecated.*/
218        double getExpiryDelay() const { return _expiryDelay; }
219
220        /** Deprecated.*/
221        void setExpiryFrames(int expiryFrames) { _expiryFrames = expiryFrames; }
222       
223        /** Deprecated.*/
224        int getExpiryFrames() const { return _expiryFrames; }
225
226        /** Deprecated.*/
227        void setReleaseDelay(double releaseDelay);
228       
229        /** Deprecated.*/
230        double getReleaseDelay() const { return _releaseDelay; }
231
232        /** Deprecated.*/
233        void setReleaseFrames(int releaseFrames) { _releaseFrames = releaseFrames; }
234       
235        /** Deprecated.*/
236        int getReleaseFrames() const { return _releaseFrames; }
237
238
239        /** Set whether the removed subgraphs should be deleted in the database thread or not.*/
240        void setDeleteRemovedSubgraphsInDatabaseThread(bool flag) { _deleteRemovedSubgraphsInDatabaseThread = flag; }
241       
242        /** Get whether the removed subgraphs should be deleted in the database thread or not.*/
243        bool getDeleteRemovedSubgraphsInDatabaseThread() const { return _deleteRemovedSubgraphsInDatabaseThread; }
244
245        enum DrawablePolicy
246        {
247            DO_NOT_MODIFY_DRAWABLE_SETTINGS,
248            USE_DISPLAY_LISTS,
249            USE_VERTEX_BUFFER_OBJECTS,
250            USE_VERTEX_ARRAYS
251        };
252
253        /** Set how loaded drawables should be handled w.r.t their display list/vertex buffer object/vertex array settings.*/
254        void setDrawablePolicy(DrawablePolicy policy) { _drawablePolicy = policy; }
255
256        /** Get how loaded drawables should be handled w.r.t their display list/vertex buffer object/vertex array settings.*/
257        DrawablePolicy getDrawablePolicy() const { return _drawablePolicy; }
258
259
260        /** Set whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value.*/
261        void setUnrefImageDataAfterApplyPolicy(bool changeAutoUnRef, bool valueAutoUnRef) { _changeAutoUnRef = changeAutoUnRef; _valueAutoUnRef = valueAutoUnRef; }
262
263        /** Get whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value.*/
264        void getUnrefImageDataAfterApplyPolicy(bool& changeAutoUnRef, bool& valueAutoUnRef) const { changeAutoUnRef = _changeAutoUnRef; valueAutoUnRef = _valueAutoUnRef; }
265
266
267        /** Set whether newly loaded textures should have their MaxAnisotopy set to a specified value.*/
268        void setMaxAnisotropyPolicy(bool changeAnisotropy, float valueAnisotropy) { _changeAnisotropy = changeAnisotropy; _valueAnisotropy = valueAnisotropy; }
269
270        /** Set whether newly loaded textures should have their MaxAnisotopy set to a specified value.*/
271        void getMaxAnisotropyPolicy(bool& changeAnisotropy, float& valueAnisotropy) const { changeAnisotropy = _changeAnisotropy; valueAnisotropy = _valueAnisotropy; }
272
273
274        /** Return true if there are pending updates to the scene graph that require a call to updateSceneGraph(double). */
275        bool requiresUpdateSceneGraph() const;
276       
277        /** Merge the changes to the scene graph by calling calling removeExpiredSubgraphs then addLoadedDataToSceneGraph.
278          * Note, must only be called from single thread update phase. */
279        virtual void updateSceneGraph(const osg::FrameStamp& frameStamp)
280        {
281            removeExpiredSubgraphs(frameStamp);
282            addLoadedDataToSceneGraph(frameStamp);
283        }
284               
285        /** Turn the compilation of rendering objects for specified graphics context on (true) or off(false). */
286        void setCompileGLObjectsForContextID(unsigned int contextID, bool on);
287       
288        /** Get whether the compilation of rendering objects for specified graphics context on (true) or off(false). */
289        bool getCompileGLObjectsForContextID(unsigned int contextID);
290
291        /** Return true if an external draw thread should call compileGLObjects(..) or not.*/
292        bool requiresExternalCompileGLObjects(unsigned int contextID) const;
293
294        /** Return true if there are pending compile operations that are required.
295          * If requiresCompileGLObjects() return true the application should call compileGLObjects() .*/
296        bool requiresCompileGLObjects() const;
297
298        /** Compile the rendering objects (display lists,texture objects, VBO's) on loaded subgraph.
299          * note, should only be called from the draw thread.
300          * Note, must only be called from a valid graphics context. */
301        virtual void compileGLObjects(osg::State& state,double& availableTime);
302       
303        /** Compile the rendering objects (display lists,texture objects, VBO's) on loaded subgraph.
304          * note, should only be called from the draw thread.
305          * Note, must only be called from a valid graphics context. */
306        virtual void compileAllGLObjects(osg::State& state);
307
308        /** Report how many items are in the _fileRequestList queue */
309        unsigned int getFileRequestListSize() const { return _fileRequestQueue->_requestList.size() + _httpRequestQueue->_requestList.size(); }
310
311        /** Report how many items are in the _dataToCompileList queue */
312        unsigned int getDataToCompileListSize() const { return _dataToCompileList->_requestList.size(); }
313       
314        /** Report how many items are in the _dataToCompileList queue */
315        unsigned int getDataToMergeListSize() const { return _dataToMergeList->_requestList.size(); }
316
317        /** Report whether any requests are in the pager.*/
318        bool getRequestsInProgress() const;
319       
320        /** Get the minimum time between the first request for a tile to be loaded and the time of its merge into the main scene graph.*/
321        double getMinimumTimeToMergeTile() const { return _minimumTimeToMergeTile; }
322
323        /** Get the maximum time between the first request for a tile to be loaded and the time of its merge into the main scene graph.*/
324        double getMaximumTimeToMergeTile() const { return _maximumTimeToMergeTile; }
325
326        /** Get the average time between the first request for a tile to be loaded and the time of its merge into the main scene graph.*/
327        double getAverageTimeToMergeTiles() const { return (_numTilesMerges > 0) ? _totalTimeToMergeTiles/static_cast<double>(_numTilesMerges) : 0; }
328
329        /** Reset the Stats variables.*/
330        void resetStats();
331
332        typedef std::list< osg::ref_ptr<osg::PagedLOD> >                PagedLODList;
333        typedef std::set< osg::ref_ptr<osg::StateSet> >                 StateSetList;
334        typedef std::vector< osg::ref_ptr<osg::Drawable> >              DrawableList;
335        typedef std::pair<StateSetList,DrawableList>                    DataToCompile;
336        typedef std::map< unsigned int, DataToCompile >                 DataToCompileMap;
337        typedef std::set<unsigned int>                                  ActiveGraphicsContexts;
338        typedef std::vector< osg::observer_ptr<osg::GraphicsContext> >  CompileGraphicsContexts;
339
340    protected:
341
342        virtual ~DatabasePager();
343
344        friend class DatabaseThread;
345        friend struct DatabaseRequest;
346
347        struct RequestQueue;
348
349        struct DatabaseRequest : public osg::Referenced
350        {
351            DatabaseRequest():
352                osg::Referenced(true),
353                _frameNumberFirstRequest(0),
354                _timestampFirstRequest(0.0),
355                _priorityFirstRequest(0.f),
356                _frameNumberLastRequest(0),
357                _timestampLastRequest(0.0),
358                _priorityLastRequest(0.0f),
359                _numOfRequests(0),
360                _requestQueue(0)
361            {}
362           
363            std::string                         _fileName;
364            int                                 _frameNumberFirstRequest;
365            double                              _timestampFirstRequest;
366            float                               _priorityFirstRequest;
367            int                                 _frameNumberLastRequest;
368            double                              _timestampLastRequest;
369            float                               _priorityLastRequest;
370            unsigned int                        _numOfRequests;
371            osg::observer_ptr<osg::Group>       _groupForAddingLoadedSubgraph;
372            osg::ref_ptr<osg::Node>             _loadedModel;
373            DataToCompileMap                    _dataToCompileMap;
374            osg::ref_ptr<Options> _loadOptions;
375            RequestQueue*                       _requestQueue;
376
377            bool isRequestCurrent (int frameNumber) const
378            {
379                return frameNumber - _frameNumberLastRequest <= 1;
380            }
381        };
382       
383        struct RequestQueue : public osg::Referenced
384        {
385            typedef std::vector< osg::ref_ptr<DatabaseRequest> > RequestList;
386
387            void sort();
388                                   
389            RequestList         _requestList;
390            OpenThreads::Mutex  _requestMutex;
391        };
392
393       
394        typedef std::vector< osg::ref_ptr<DatabaseThread> > DatabaseThreadList;
395        typedef std::vector<  osg::ref_ptr<osg::Object> > ObjectList;
396
397        struct ReadQueue : public RequestQueue
398        {
399            ReadQueue(DatabasePager* pager, const std::string& name);
400           
401            void block() { _block->block(); }
402           
403            void release() { _block->release(); }
404           
405            void updateBlock()
406            {
407                _block->set((!_requestList.empty() || !_childrenToDeleteList.empty()) &&
408                             !_pager->_databasePagerThreadPaused);
409            }
410           
411            void clear();
412           
413            void add(DatabaseRequest* databaseRequest);
414           
415            void takeFirst(osg::ref_ptr<DatabaseRequest>& databaseRequest);
416           
417            osg::ref_ptr<osg::RefBlock> _block;
418           
419            DatabasePager*              _pager;
420            std::string                 _name;
421           
422            OpenThreads::Mutex          _childrenToDeleteListMutex;
423            ObjectList                  _childrenToDeleteList;
424        };
425
426        // forward declare inner helper classes
427        class FindCompileableGLObjectsVisitor;
428        friend class FindCompileableGLObjectsVisitor;
429       
430        class MarkPagedLODsVisitor;
431       
432        class FindPagedLODsVisitor;
433        friend class FindPagedLODsVisitor;
434
435        struct SortFileRequestFunctor;
436        friend struct SortFileRequestFunctor;
437
438       
439        OpenThreads::Mutex              _run_mutex;
440        bool                            _startThreadCalled;
441
442        // Helper functions for determining if objects need to be
443        // compiled.
444        inline static bool isCompiled(const osg::Texture* texture,
445                                      unsigned int contextID)
446        {
447            return( texture->getTextureObject(contextID) != NULL );
448        }
449        // Is texture compiled for all active contexts?
450        inline bool isCompiled(osg::Texture* texture) const
451        {
452            for (ActiveGraphicsContexts::const_iterator iter=_activeGraphicsContexts.begin();
453                   iter!=_activeGraphicsContexts.end(); ++iter )
454            {
455                if ( texture->getTextureObject(*iter) == NULL ) return false;
456            }
457            return true;
458        }
459       
460        inline static bool isCompiled(const osg::StateSet* stateSet,
461                                      unsigned int contextID)
462        {
463            for (unsigned i = 0;
464                 i < stateSet->getTextureAttributeList().size();
465                 ++i)
466            {
467                const osg::Texture* texture
468                    = dynamic_cast<const osg::Texture*>(stateSet->getTextureAttribute(i,osg::StateAttribute::TEXTURE));
469                if (texture && !isCompiled(texture, contextID))
470                    return false;
471            }
472            return true;
473        }
474
475        inline bool isCompiled(osg::StateSet* stateSet)
476        {
477            for (unsigned i = 0;
478                 i < stateSet->getTextureAttributeList().size();
479                 ++i)
480            {
481                osg::Texture* texture
482                    = dynamic_cast<osg::Texture*>(stateSet->getTextureAttribute(i,osg::StateAttribute::TEXTURE));
483                if (texture)
484                {
485                    for (ActiveGraphicsContexts::iterator iter=_activeGraphicsContexts.begin();
486                            iter!=_activeGraphicsContexts.end(); ++iter )
487                    {
488                        if ( texture->getTextureObject(*iter) == NULL ) return false;
489                    }
490                }
491            }
492            return true;
493        }
494       
495        inline static bool isCompiled(const osg::Drawable* drawable,
496                                      unsigned int contextID)
497        {
498            // Worry about vbos later
499            if (drawable->getUseDisplayList())
500            {
501                return drawable->getDisplayList(contextID) != 0;
502            }
503            return true;
504        }
505
506        inline bool isCompiled(const osg::Drawable* drawable) const
507        {
508            if (drawable->getUseDisplayList())
509            {
510                for (ActiveGraphicsContexts::const_iterator iter=_activeGraphicsContexts.begin();
511                        iter!=_activeGraphicsContexts.end(); ++iter )
512                {
513                    if ( drawable->getDisplayList(*iter) == 0 ) return false;
514                }
515            }
516            return true;
517        }
518
519       
520        /** Iterate through the active PagedLOD nodes children removing
521          * children which havn't been visited since specified expiryTime.
522          * note, should be only be called from the update thread. */
523        virtual void removeExpiredSubgraphs(const osg::FrameStamp &frameStamp);
524
525        /** Old expiry delay based removeExpiredSubgraphs. */
526        virtual void expiry_removeExpiredSubgraphs(const osg::FrameStamp &frameStamp);
527
528        /** New capped based removeExpiredSubgraphs. */
529        virtual void capped_removeExpiredSubgraphs(const osg::FrameStamp &frameStamp);
530
531        /** Add the loaded data to the scene graph.*/
532        void addLoadedDataToSceneGraph(const osg::FrameStamp &frameStamp);
533
534
535        bool                            _done;
536        bool                            _acceptNewRequests;
537        bool                            _databasePagerThreadPaused;
538   
539        DatabaseThreadList              _databaseThreads;
540
541        int                             _numFramesActive;
542        mutable OpenThreads::Mutex      _numFramesActiveMutex;
543        int                             _frameNumber;
544
545        osg::ref_ptr<ReadQueue>         _fileRequestQueue;
546        osg::ref_ptr<ReadQueue>         _httpRequestQueue;
547
548         
549        osg::ref_ptr<RequestQueue>      _dataToCompileList;
550
551        DrawablePolicy                  _drawablePolicy;
552
553        bool                            _changeAutoUnRef;
554        bool                            _valueAutoUnRef;
555        bool                            _changeAnisotropy;
556        float                           _valueAnisotropy;
557
558        bool                            _deleteRemovedSubgraphsInDatabaseThread;
559
560        osg::ref_ptr<RequestQueue>      _dataToMergeList;
561       
562        PagedLODList                    _activePagedLODList;
563        PagedLODList                    _inactivePagedLODList;
564       
565        unsigned int                    _targetMaximumNumberOfPageLOD;
566
567        double                          _expiryDelay;
568        int                             _expiryFrames;
569
570        double                          _releaseDelay;
571        int                             _releaseFrames;
572
573        ActiveGraphicsContexts          _activeGraphicsContexts;
574        // CompileGraphicsContexts         _compileGraphicsContexts;
575       
576        bool                            _doPreCompile;
577        double                          _targetFrameRate;
578        double                          _minimumTimeAvailableForGLCompileAndDeletePerFrame;
579        unsigned int                    _maximumNumOfObjectsToCompilePerFrame;
580       
581        double                          _minimumTimeToMergeTile;
582        double                          _maximumTimeToMergeTile;
583        double                          _totalTimeToMergeTiles;
584        unsigned int                    _numTilesMerges;
585       
586        struct CompileOperation : public osg::GraphicsOperation
587        {
588            CompileOperation(DatabasePager* databasePager);
589           
590            virtual void operator () (osg::GraphicsContext* context);
591           
592            osg::observer_ptr<DatabasePager> _databasePager;
593        };
594};
595
596}
597
598#endif
Note: See TracBrowser for help on using the browser.