Refactored the implementation of cull/draw for DrawThreadPerContex and CullThreadPerCameraDrawThreadPerContex

and added an experimental draw serialization.
This commit is contained in:
Robert Osfield
2007-08-22 17:17:25 +00:00
parent dee0c92ffc
commit 1694cf9625
2 changed files with 113 additions and 91 deletions

View File

@@ -81,21 +81,40 @@ class OSGVIEWER_EXPORT Renderer : public osg::GraphicsOperation, public OpenGLQu
virtual ~Renderer();
bool _serializeDraw;
osg::observer_ptr<osg::Camera> _camera;
bool _done;
bool _graphicsThreadDoesCull;
unsigned int _currentCull;
unsigned int _currentDraw;
OpenThreads::Mutex _mutex[2];
bool _lockHeld[2];
osg::ref_ptr<osgUtil::SceneView> _sceneView[2];
int _frameNumber[2];
osg::ref_ptr<osg::FlushDeletedGLObjectsOperation> _flushOperation;
struct TheadSafeQueue
{
OpenThreads::Mutex _mutex;
OpenThreads::Block _block;
typedef std::list<osgUtil::SceneView*> SceneViewList;
SceneViewList _queue;
void release()
{
_block.release();
}
osgUtil::SceneView* takeFront();
void add(osgUtil::SceneView* sv);
};
TheadSafeQueue _availableQueue;
TheadSafeQueue _drawQueue;
};
}