Introduced OpenThreads::Affinity support into osg::Camera, osg::GraphicsContext::Traitse, osgDB::DatabasePager and osgViewer::ViewerBase/Viewer/CompositeViewer.
Added ViewerBase::configureAffinity() to help with the setting of the affinity of camera, graphics context and pager threads
This commit is contained in:
@@ -541,6 +541,11 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
|
||||
}
|
||||
}
|
||||
|
||||
/** Set the process affinity hint for any Camera Threads that are/will be assigned to this Camera.*/
|
||||
void setProcessorAffinity(const OpenThreads::Affinity& affinity);
|
||||
OpenThreads::Affinity& getProcessorAffinity() { return _affinity; }
|
||||
const OpenThreads::Affinity& getProcessorAffinity() const { return _affinity; }
|
||||
|
||||
/** Create a operation thread for this camera.*/
|
||||
void createCameraThread();
|
||||
|
||||
@@ -707,6 +712,7 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
|
||||
|
||||
unsigned int _attachmentMapModifiedCount;
|
||||
|
||||
OpenThreads::Affinity _affinity;
|
||||
ref_ptr<OperationThread> _cameraThread;
|
||||
|
||||
ref_ptr<GraphicsContext> _graphicsContext;
|
||||
|
||||
@@ -145,6 +145,9 @@ class OSG_EXPORT GraphicsContext : public Object
|
||||
bool overrideRedirect;
|
||||
|
||||
DisplaySettings::SwapMethod swapMethod;
|
||||
|
||||
// hint of what affinity to use for any thrads associated with the graphics context created using these Traits
|
||||
OpenThreads::Affinity affinity;
|
||||
};
|
||||
|
||||
/** Simple resolution structure used by WindowingSystemInterface to get and set screen resolution.
|
||||
|
||||
Reference in New Issue
Block a user