Added selective support for thread safe ref/unref such that the rendering
backend now doesn't use thread safe ref counting where multi-buffering exists. This reduces the overhead of multi-threading.
This commit is contained in:
@@ -62,6 +62,14 @@ Referenced::Referenced():
|
||||
if (s_useThreadSafeReferenceCounting) _refMutex = new OpenThreads::Mutex;
|
||||
}
|
||||
|
||||
Referenced::Referenced(bool threadSafeRefUnref):
|
||||
_refMutex(0),
|
||||
_refCount(0),
|
||||
_observers(0)
|
||||
{
|
||||
if (threadSafeRefUnref) _refMutex = new OpenThreads::Mutex;
|
||||
}
|
||||
|
||||
Referenced::Referenced(const Referenced&):
|
||||
_refMutex(0),
|
||||
_refCount(0),
|
||||
|
||||
@@ -992,7 +992,7 @@ void CullVisitor::apply(Projection& node)
|
||||
_computed_zfar = -FLT_MAX;
|
||||
|
||||
|
||||
ref_ptr<osg::RefMatrix> matrix = createOrReuseMatrix(node.getMatrix());
|
||||
ref_ptr<RefMatrix> matrix = createOrReuseMatrix(node.getMatrix());
|
||||
pushProjectionMatrix(matrix.get());
|
||||
|
||||
//osg::notify(osg::INFO)<<"Push projection "<<*matrix<<std::endl;
|
||||
@@ -1074,7 +1074,7 @@ void CullVisitor::apply(osg::CameraNode& camera)
|
||||
setComputeNearFarMode( camera.getComputeNearFarMode());
|
||||
|
||||
|
||||
osg::RefMatrix& originalModelView = getModelViewMatrix();
|
||||
RefMatrix& originalModelView = getModelViewMatrix();
|
||||
|
||||
if (camera.getReferenceFrame()==osg::Transform::ABSOLUTE_RF)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user