2006-07-18 23:21:48 +08:00
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2003-07-08 22:44:00 +08:00
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
2003-07-21 16:19:36 +08:00
#ifndef OSGDB_DATABASEPAGER
#define OSGDB_DATABASEPAGER 1
2003-07-08 22:44:00 +08:00
#include <osg/NodeVisitor>
#include <osg/Group>
#include <osg/PagedLOD>
2003-07-10 03:48:04 +08:00
#include <osg/Drawable>
2005-08-19 04:17:51 +08:00
#include <osg/GraphicsThread>
2003-07-08 22:44:00 +08:00
2003-07-19 08:18:07 +08:00
#include <OpenThreads/Thread>
#include <OpenThreads/Mutex>
2004-05-08 03:55:12 +08:00
#include <OpenThreads/ScopedLock>
2003-10-12 22:51:54 +08:00
#include <OpenThreads/Condition>
2003-10-12 20:13:58 +08:00
2004-01-11 01:13:20 +08:00
#include <osgDB/SharedStateManager>
2006-12-05 22:50:46 +08:00
#include <osgDB/ReaderWriter>
2003-07-21 16:19:36 +08:00
#include <osgDB/Export>
2003-07-08 22:44:00 +08:00
2003-07-10 03:48:04 +08:00
#include <map>
2004-09-22 01:26:08 +08:00
#include <list>
2007-12-11 20:32:31 +08:00
#include <algorithm>
#include <functional>
2003-07-10 03:48:04 +08:00
2003-07-21 16:19:36 +08:00
namespace osgDB {
2003-07-08 22:44:00 +08:00
2003-10-12 22:51:54 +08:00
2003-07-08 22:44:00 +08:00
/** Database paging class which manages the loading of files in a background thread,
2007-12-11 01:30:18 +08:00
* and synchronizing of loaded models with the main scene graph.*/
2003-07-21 16:19:36 +08:00
class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandler, public OpenThreads::Thread
2003-07-08 22:44:00 +08:00
{
public :
2005-05-16 04:32:10 +08:00
typedef OpenThreads::Thread::ThreadPriority ThreadPriority;
2003-07-08 22:44:00 +08:00
DatabasePager();
2007-08-08 16:10:38 +08:00
DatabasePager(const DatabasePager& rhs);
/** Create a shallow copy on the DatabasePager.*/
virtual DatabasePager* clone() const { return new DatabasePager(*this); }
/** get the prototype singleton used by DatabasePager::create().*/
static osg::ref_ptr<DatabasePager>& prototype();
/** create a DatabasePager by cloning DatabasePager::prototype().*/
static DatabasePager* create();
2003-07-09 22:55:39 +08:00
/** Add a request to load a node file to end the the database request list.*/
2006-12-05 22:50:46 +08:00
virtual void requestNodeFile(const std::string& fileName,osg::Group* group,
float priority, const osg::FrameStamp* framestamp);
virtual void requestNodeFile(const std::string& fileName,osg::Group* group,
float priority, const osg::FrameStamp* framestamp,
ReaderWriter::Options* loadOptions);
2003-07-08 22:44:00 +08:00
2004-09-20 04:09:54 +08:00
/** Run does the database paging.*/
2003-07-08 22:44:00 +08:00
virtual void run();
2004-09-20 04:09:54 +08:00
/** Cancel the database pager thread.*/
virtual int cancel();
/** Clear all internally cached structures.*/
2004-11-17 22:25:17 +08:00
virtual void clear();
2004-09-20 04:09:54 +08:00
/** Set whether the database pager thread should be paused or not.*/
void setDatabasePagerThreadPause(bool pause);
/** Get whether the database pager thread should is paused or not.*/
bool getDatabasePagerThreadPause() const { return _databasePagerThreadPaused; }
/** Set whether new database request calls are accepted or ignored.*/
void setAcceptNewDatabaseRequests(bool acceptNewRequests) { _acceptNewRequests = acceptNewRequests; }
/** Get whether new database request calls are accepted or ignored.*/
bool getAcceptNewDatabaseRequests() const { return _acceptNewRequests; }
2004-09-28 16:39:46 +08:00
/** Get the number of frames that are currently active.*/
int getNumFramesActive() const { return _numFramesActive; }
2003-10-12 20:13:58 +08:00
/** Signal the database thread that the update, cull and draw has begun for a new frame.
* 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. */
2004-11-17 22:25:17 +08:00
virtual void signalBeginFrame(const osg::FrameStamp* framestamp);
2003-10-12 20:13:58 +08:00
/** Signal the database thread that the update, cull and draw dispatch has completed.
* 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.*/
2004-11-17 22:25:17 +08:00
virtual void signalEndFrame();
2003-10-12 20:13:58 +08:00
2003-07-09 22:55:39 +08:00
/** Find all PagedLOD nodes in a subgraph and register them with
* the DatabasePager so it can keep track of expired nodes.
* note, should be only be called from the update thread. */
2004-11-17 22:25:17 +08:00
virtual void registerPagedLODs(osg::Node* subgraph);
2003-07-08 22:44:00 +08:00
2005-05-31 13:37:13 +08:00
/** Set whether the database pager should pre compile OpenGL objects before allowing
* them to be merged into the scene graph.
* Pre compilation helps reduce the chances of frame drops, but also slows the
* speed at which tiles are merged as they have to be compiled first.*/
void setDoPreCompile(bool flag) { _doPreCompile = flag; }
/** Get whether the database pager should pre compile OpenGL objects before allowing
* them to be merged into the scene graph.*/
bool getDoPreCompile() const { return _doPreCompile; }
2003-07-09 22:55:39 +08:00
2005-03-18 03:32:09 +08:00
/** Set the target frame rate that the DatabasePager should assume.
* Typically one would set this to the value refresh rate of your display system i.e. 60Hz.
* Default value is 100.
* Usage notes. The TargetFrameRate and the MinimumTimeAvailableForGLCompileAndDeletePerFrame
* parameters are not directly used by DatabasePager, but are should be used as a guide for how
* long to set aside per frame for compiling and deleting OpenGL objects - ie. the value to use
* when calling DatabasePager::compileGLObjectgs(state,availableTime,). The longer amount of
* time to set aside cthe faster databases will be paged in but with increased chance of frame drops,
* the lower the amount of time the set aside the slower databases will paged it but with better
* chance of avoid any frame drops. The default values are chosen to achieve the later when running
* on a modern mid to high end PC.
* The way to compute the amount of available time use a scheme such as :
* availableTime = maximum(1.0/targetFrameRate - timeTakenDuringUpdateCullAndDraw, minimumTimeAvailableForGLCompileAndDeletePerFrame).
*/
void setTargetFrameRate(double tfr) { _targetFrameRate = tfr; }
/** Get the target frame rate that the DatabasePager should assume.*/
double getTargetFrameRate() const { return _targetFrameRate; }
/** Set the minimum amount of time (in seconds) that should be made available for compiling and delete OpenGL objects per frame.
* Default value is 0.001 (1 millisecond).
* For usage see notes in setTargetFrameRate.*/
void setMinimumTimeAvailableForGLCompileAndDeletePerFrame(double ta) { _minimumTimeAvailableForGLCompileAndDeletePerFrame = ta; }
/** Get the minimum amount of time that should be made available for compiling and delete OpenGL objects per frame.
* For usage see notes in setTargetFrameRate.*/
double getMinimumTimeAvailableForGLCompileAndDeletePerFrame() const { return _minimumTimeAvailableForGLCompileAndDeletePerFrame; }
/** Set the maximum number of OpenGL objects that the page should attempt to compile per frame.
* Note, Lower values reduces chances of a frame drop but lower the rate that database will be paged in at.
* Default value is 8. */
void setMaximumNumOfObjectsToCompilePerFrame(unsigned int num) { _maximumNumOfObjectsToCompilePerFrame = num; }
/** Get the maximum number of OpenGL objects that the page should attempt to compile per frame.*/
unsigned int getMaximumNumOfObjectsToCompilePerFrame() const { return _maximumNumOfObjectsToCompilePerFrame; }
2003-07-08 22:44:00 +08:00
/** Set the amount of time that a subgraph will be kept without being visited in the cull traversal
* before being removed.*/
void setExpiryDelay(double expiryDelay) { _expiryDelay = expiryDelay; }
/** Get the amount of time that a subgraph will be kept without being visited in the cull traversal
* before being removed.*/
double getExpiryDelay() const { return _expiryDelay; }
2005-11-22 21:14:00 +08:00
/** Set whether the removed subgraphs should be deleted in the database thread or not.*/
2003-07-09 22:55:39 +08:00
void setDeleteRemovedSubgraphsInDatabaseThread(bool flag) { _deleteRemovedSubgraphsInDatabaseThread = flag; }
2005-11-22 21:14:00 +08:00
/** Get whether the removed subgraphs should be deleted in the database thread or not.*/
2003-07-09 22:55:39 +08:00
bool getDeleteRemovedSubgraphsInDatabaseThread() const { return _deleteRemovedSubgraphsInDatabaseThread; }
2005-11-22 21:14:00 +08:00
enum DrawablePolicy
{
DO_NOT_MODIFY_DRAWABLE_SETTINGS,
USE_DISPLAY_LISTS,
USE_VERTEX_BUFFER_OBJECTS,
USE_VERTEX_ARRAYS
};
/** Set how loaded drawables should be handled w.r.t their display list/vertex buffer object/vertex array settings.*/
void setDrawablePolicy(DrawablePolicy policy) { _drawablePolicy = policy; }
2004-07-20 13:37:59 +08:00
2005-11-22 21:14:00 +08:00
/** Get how loaded drawables should be handled w.r.t their display list/vertex buffer object/vertex array settings.*/
DrawablePolicy getDrawablePolicy() const { return _drawablePolicy; }
/** Set whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value.*/
2004-07-20 13:37:59 +08:00
void setUnrefImageDataAfterApplyPolicy(bool changeAutoUnRef, bool valueAutoUnRef) { _changeAutoUnRef = changeAutoUnRef; _valueAutoUnRef = valueAutoUnRef; }
2005-11-22 21:14:00 +08:00
/** Get whether newly loaded textures should have their UnrefImageDataAfterApply set to a specified value.*/
2004-07-20 13:37:59 +08:00
void getUnrefImageDataAfterApplyPolicy(bool& changeAutoUnRef, bool& valueAutoUnRef) const { changeAutoUnRef = _changeAutoUnRef; valueAutoUnRef = _valueAutoUnRef; }
2005-11-22 21:14:00 +08:00
/** Set whether newly loaded textures should have their MaxAnisotopy set to a specified value.*/
2004-07-20 13:37:59 +08:00
void setMaxAnisotropyPolicy(bool changeAnisotropy, float valueAnisotropy) { _changeAnisotropy = changeAnisotropy; _valueAnisotropy = valueAnisotropy; }
2005-11-22 21:14:00 +08:00
/** Set whether newly loaded textures should have their MaxAnisotopy set to a specified value.*/
2004-07-20 13:37:59 +08:00
void getMaxAnisotropyPolicy(bool& changeAnisotropy, float& valueAnisotropy) const { changeAnisotropy = _changeAnisotropy; valueAnisotropy = _valueAnisotropy; }
2004-09-24 04:13:16 +08:00
/** Return true if there are pending updates to the scene graph that require a call to updateSceneGraph(double). */
2004-09-24 02:50:38 +08:00
bool requiresUpdateSceneGraph() const;
2004-01-07 05:18:36 +08:00
2004-09-24 02:50:38 +08:00
/** Merge the changes to the scene graph by calling calling removeExpiredSubgraphs then addLoadedDataToSceneGraph.
* Note, must only be called from single thread update phase. */
2004-11-17 22:25:17 +08:00
virtual void updateSceneGraph(double currentFrameTime)
2004-01-07 05:18:36 +08:00
{
removeExpiredSubgraphs(currentFrameTime);
addLoadedDataToSceneGraph(currentFrameTime);
}
2003-07-08 22:44:00 +08:00
2007-12-11 01:30:18 +08:00
/** Turn the compilation of rendering objects for specified graphics context on (true) or off(false). */
2004-09-22 05:33:52 +08:00
void setCompileGLObjectsForContextID(unsigned int contextID, bool on);
2003-07-10 19:10:39 +08:00
2007-12-11 01:30:18 +08:00
/** Get whether the compilation of rendering objects for specified graphics context on (true) or off(false). */
2004-09-22 05:33:52 +08:00
bool getCompileGLObjectsForContextID(unsigned int contextID);
2003-07-10 19:10:39 +08:00
2007-12-11 01:30:18 +08:00
/** Return true if an external draw thread should call compileGLObjects(..) or not.*/
2007-06-22 22:48:18 +08:00
bool requiresExternalCompileGLObjects(unsigned int contextID) const;
2004-09-24 02:50:38 +08:00
/** Return true if there are pending compile operations that are required.
* If requiresCompileGLObjects() return true the application should call compileGLObjects() .*/
bool requiresCompileGLObjects() const;
2003-07-09 22:55:39 +08:00
/** Compile the rendering objects (display lists,texture objects, VBO's) on loaded subgraph.
2004-09-24 02:50:38 +08:00
* note, should only be called from the draw thread.
* Note, must only be called from a valid graphics context. */
2004-11-17 22:25:17 +08:00
virtual void compileGLObjects(osg::State& state,double& availableTime);
2006-02-05 05:06:48 +08:00
2007-06-22 22:48:18 +08:00
/** Compile the rendering objects (display lists,texture objects, VBO's) on loaded subgraph.
* note, should only be called from the draw thread.
* Note, must only be called from a valid graphics context. */
virtual void compileAllGLObjects(osg::State& state);
2006-02-05 05:06:48 +08:00
/** Report how many items are in the _fileRequestList queue */
unsigned int getFileRequestListSize() const { return _fileRequestList.size(); }
/** Report how many items are in the _dataToCompileList queue */
unsigned int getDataToCompileListSize() const { return _dataToCompileList.size(); }
2007-08-24 21:33:35 +08:00
/** 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.*/
double getMinimumTimeToMergeTile() const { return _minimumTimeToMergeTile; }
/** 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.*/
double getMaximumTimeToMergeTile() const { return _maximumTimeToMergeTile; }
/** 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.*/
double getAverageTimeToMergeTiles() const { return _totalTimeToMergeTiles/static_cast<double>(_numTilesMerges); }
/** Reset the Stats variables.*/
void resetStats();
2006-02-05 05:06:48 +08:00
2007-12-07 01:31:00 +08:00
/** Set the maximum number of PagedLOD child to remove per frame */
void setMaximumNumOfRemovedChildPagedLODs(unsigned int number) { _maximumNumOfRemovedChildPagedLODs = number; }
/** Get the maximum number of PagedLOD child to remove per frame */
unsigned int getMaximumNumOfRemovedChildPagedLODs() const { return _maximumNumOfRemovedChildPagedLODs; }
/** Set the minimum number of inactive PagedLOD child to keep */
void setMinimumNumOfInactivePagedLODs(unsigned int number) { _minimumNumOfInactivePagedLODs = number; }
/** Get the minimum number of inactive PagedLOD child to keep */
unsigned int getMinimumNumOfInactivePagedLODs() const { return _minimumNumOfInactivePagedLODs; }
2003-07-08 22:44:00 +08:00
2007-06-22 22:48:18 +08:00
typedef std::list< osg::ref_ptr<osg::PagedLOD> > PagedLODList;
typedef std::set< osg::ref_ptr<osg::StateSet> > StateSetList;
typedef std::vector< osg::ref_ptr<osg::Drawable> > DrawableList;
typedef std::pair<StateSetList,DrawableList> DataToCompile;
typedef std::map< unsigned int, DataToCompile > DataToCompileMap;
typedef std::set<unsigned int> ActiveGraphicsContexts;
typedef std::vector< osg::observer_ptr<osg::GraphicsContext> > CompileGraphicsContexts;
2003-07-15 17:39:45 +08:00
2004-11-29 11:05:27 +08:00
protected:
virtual ~DatabasePager();
2004-11-18 20:07:28 +08:00
friend struct DatabaseRequest;
2007-12-11 20:32:31 +08:00
2003-07-08 22:44:00 +08:00
struct DatabaseRequest : public osg::Referenced
{
DatabaseRequest():
_numOfRequests(0)
{}
2003-10-11 03:25:14 +08:00
2003-07-08 22:44:00 +08:00
std::string _fileName;
2003-10-12 20:13:58 +08:00
int _frameNumberFirstRequest;
2003-10-11 03:25:14 +08:00
double _timestampFirstRequest;
float _priorityFirstRequest;
2003-10-12 20:13:58 +08:00
int _frameNumberLastRequest;
2003-10-11 03:25:14 +08:00
double _timestampLastRequest;
float _priorityLastRequest;
2003-07-08 22:44:00 +08:00
unsigned int _numOfRequests;
osg::ref_ptr<osg::Group> _groupForAddingLoadedSubgraph;
osg::ref_ptr<osg::Node> _loadedModel;
2003-07-10 03:48:04 +08:00
DataToCompileMap _dataToCompileMap;
2006-12-05 22:50:46 +08:00
osg::ref_ptr<ReaderWriter::Options> _loadOptions;
2007-12-11 20:32:31 +08:00
bool isRequestCurrent (int frameNumber) const
{
return frameNumber - _frameNumberLastRequest <= 1;
}
2003-07-08 22:44:00 +08:00
};
2007-12-11 20:32:31 +08:00
2003-07-08 22:44:00 +08:00
typedef std::vector< osg::ref_ptr<DatabaseRequest> > DatabaseRequestList;
2004-01-27 22:49:59 +08:00
typedef std::vector< osg::ref_ptr<osg::Object> > ObjectList;
2003-07-08 22:44:00 +08:00
2004-11-17 22:25:17 +08:00
// forward declare inner helper classes
class FindCompileableGLObjectsVisitor;
friend class FindCompileableGLObjectsVisitor;
class FindPagedLODsVisitor;
friend class FindPagedLODsVisitor;
2004-11-18 17:09:22 +08:00
struct SortFileRequestFunctor;
friend struct SortFileRequestFunctor;
2003-10-11 03:25:14 +08:00
2004-09-19 03:28:45 +08:00
2004-09-22 05:33:52 +08:00
OpenThreads::Mutex _run_mutex;
bool _startThreadCalled;
2007-02-24 00:31:34 +08:00
osg::ref_ptr<osg::RefBlock> _databasePagerThreadBlock;
2004-09-19 03:28:45 +08:00
inline void updateDatabasePagerThreadBlock()
{
_databasePagerThreadBlock->set(
2004-09-20 04:09:54 +08:00
(!_fileRequestList.empty() || !_childrenToDeleteList.empty()) && !_databasePagerThreadPaused);
2004-09-19 03:28:45 +08:00
}
2007-12-11 20:32:31 +08:00
// Helper functions for determining if objects need to be
// compiled.
inline static bool isCompiled(const osg::Texture* texture,
unsigned int contextID)
{
2007-12-12 17:45:29 +08:00
return( texture->getTextureObject(contextID) != NULL );
2007-12-11 20:32:31 +08:00
}
// Is texture compiled for all active contexts?
inline bool isCompiled(osg::Texture* texture) const
{
2008-01-09 19:42:19 +08:00
for (ActiveGraphicsContexts::const_iterator iter=_activeGraphicsContexts.begin();
2008-01-09 02:13:06 +08:00
iter!=_activeGraphicsContexts.end(); ++iter )
{
if ( texture->getTextureObject(*iter) == NULL ) return false;
}
return true;
2007-12-11 20:32:31 +08:00
}
inline static bool isCompiled(const osg::StateSet* stateSet,
unsigned int contextID)
{
for (unsigned i = 0;
i < stateSet->getTextureAttributeList().size();
++i)
{
const osg::Texture* texture
= dynamic_cast<const osg::Texture*>(stateSet->getTextureAttribute(i,osg::StateAttribute::TEXTURE));
if (texture && !isCompiled(texture, contextID))
return false;
}
return true;
}
inline bool isCompiled(osg::StateSet* stateSet)
{
for (unsigned i = 0;
i < stateSet->getTextureAttributeList().size();
++i)
{
osg::Texture* texture
= dynamic_cast<osg::Texture*>(stateSet->getTextureAttribute(i,osg::StateAttribute::TEXTURE));
2008-01-09 02:13:06 +08:00
if (texture)
{
for (ActiveGraphicsContexts::iterator iter=_activeGraphicsContexts.begin();
iter!=_activeGraphicsContexts.end(); ++iter )
{
if ( texture->getTextureObject(*iter) == NULL ) return false;
}
}
2007-12-11 20:32:31 +08:00
}
return true;
}
2004-09-28 16:39:46 +08:00
2007-12-11 20:32:31 +08:00
inline static bool isCompiled(const osg::Drawable* drawable,
unsigned int contextID)
{
// Worry about vbos later
if (drawable->getUseDisplayList())
{
return drawable->getDisplayList(contextID) != 0;
}
return true;
}
2004-09-20 04:09:54 +08:00
2007-12-11 20:32:31 +08:00
inline bool isCompiled(const osg::Drawable* drawable) const
{
if (drawable->getUseDisplayList())
{
2008-01-09 19:42:19 +08:00
for (ActiveGraphicsContexts::const_iterator iter=_activeGraphicsContexts.begin();
2008-01-09 02:13:06 +08:00
iter!=_activeGraphicsContexts.end(); ++iter )
{
if ( drawable->getDisplayList(*iter) == 0 ) return false;
}
2007-12-11 20:32:31 +08:00
}
return true;
}
2004-09-24 02:50:38 +08:00
/** Iterate through the active PagedLOD nodes children removing
* children which havn't been visited since specified expiryTime.
* note, should be only be called from the update thread. */
2005-08-26 02:18:27 +08:00
virtual void removeExpiredSubgraphs(double currentFrameTime);
2004-09-24 02:50:38 +08:00
/** Add the loaded data to the scene graph.*/
void addLoadedDataToSceneGraph(double currentFrameTime);
2004-09-20 04:09:54 +08:00
bool _done;
bool _acceptNewRequests;
bool _databasePagerThreadPaused;
2004-09-28 16:39:46 +08:00
int _numFramesActive;
mutable OpenThreads::Mutex _numFramesActiveMutex;
2003-10-12 20:13:58 +08:00
int _frameNumber;
DatabaseRequestList _fileRequestList;
2004-09-24 02:50:38 +08:00
mutable OpenThreads::Mutex _fileRequestListMutex;
2003-07-08 22:44:00 +08:00
2003-10-12 20:13:58 +08:00
DatabaseRequestList _dataToCompileList;
2004-09-24 02:50:38 +08:00
mutable OpenThreads::Mutex _dataToCompileListMutex;
2004-07-20 13:37:59 +08:00
2005-11-22 21:14:00 +08:00
DrawablePolicy _drawablePolicy;
2004-07-20 13:37:59 +08:00
bool _changeAutoUnRef;
bool _valueAutoUnRef;
bool _changeAnisotropy;
float _valueAnisotropy;
2004-01-27 22:49:59 +08:00
2003-10-12 20:13:58 +08:00
bool _deleteRemovedSubgraphsInDatabaseThread;
2004-01-27 22:49:59 +08:00
ObjectList _childrenToDeleteList;
2004-09-24 02:50:38 +08:00
mutable OpenThreads::Mutex _childrenToDeleteListMutex;
2003-07-09 22:55:39 +08:00
2003-10-12 20:13:58 +08:00
DatabaseRequestList _dataToMergeList;
2004-09-24 02:50:38 +08:00
mutable OpenThreads::Mutex _dataToMergeListMutex;
2003-07-09 22:55:39 +08:00
2003-07-08 22:44:00 +08:00
2004-09-22 01:26:08 +08:00
PagedLODList _activePagedLODList;
PagedLODList _inactivePagedLODList;
2003-07-08 22:44:00 +08:00
2003-10-12 20:13:58 +08:00
double _expiryDelay;
2003-07-08 22:44:00 +08:00
2003-10-12 20:13:58 +08:00
ActiveGraphicsContexts _activeGraphicsContexts;
2007-07-06 21:08:51 +08:00
// CompileGraphicsContexts _compileGraphicsContexts;
2005-03-18 03:32:09 +08:00
2005-05-31 13:37:13 +08:00
bool _doPreCompile;
2005-03-18 03:32:09 +08:00
double _targetFrameRate;
double _minimumTimeAvailableForGLCompileAndDeletePerFrame;
unsigned int _maximumNumOfObjectsToCompilePerFrame;
2007-12-07 01:31:00 +08:00
unsigned int _maximumNumOfRemovedChildPagedLODs;
unsigned int _minimumNumOfInactivePagedLODs;
2007-06-22 22:48:18 +08:00
2007-08-24 21:33:35 +08:00
double _minimumTimeToMergeTile;
double _maximumTimeToMergeTile;
double _totalTimeToMergeTiles;
unsigned int _numTilesMerges;
2007-07-14 01:25:35 +08:00
struct CompileOperation : public osg::GraphicsOperation
2007-06-22 22:48:18 +08:00
{
CompileOperation(DatabasePager* databasePager);
2007-07-14 01:25:35 +08:00
virtual void operator () (osg::GraphicsContext* context);
2007-06-22 22:48:18 +08:00
osg::observer_ptr<DatabasePager> _databasePager;
};
2003-07-08 22:44:00 +08:00
};
}
#endif