From Tim Moore, Fix for drivers that don't properly support timer extensions.
""
This commit is contained in:
parent
e2a315ee49
commit
043ae090a5
@ -609,7 +609,7 @@ class OSG_EXPORT Drawable : public Object
|
||||
void setTimerQuerySupported(bool flag) { _isTimerQuerySupported = flag; }
|
||||
bool isTimerQuerySupported() const { return _isTimerQuerySupported; }
|
||||
void setARBTimerQuerySupported(bool flag) { _isARBTimerQuerySupported = flag; }
|
||||
bool isARBTimerQuerySupported() { return _isARBTimerQuerySupported; }
|
||||
bool isARBTimerQuerySupported() const { return _isARBTimerQuerySupported; }
|
||||
void glSecondaryColor3ubv(const GLubyte* coord) const;
|
||||
void glSecondaryColor3fv(const GLfloat* coord) const;
|
||||
|
||||
|
@ -410,7 +410,7 @@ void Renderer::initialize(osg::State* state)
|
||||
{
|
||||
_initialized = true;
|
||||
osg::Drawable::Extensions* ext = osg::Drawable::getExtensions(state->getContextID(), true);
|
||||
if (ext->isARBTimerQuerySupported())
|
||||
if (ext->isARBTimerQuerySupported() && state->getTimestampBits() > 0)
|
||||
_querySupport = new ARBQuerySupport();
|
||||
else if (ext->isTimerQuerySupported())
|
||||
_querySupport = new EXTQuerySupport();
|
||||
|
@ -1090,9 +1090,13 @@ void StatsHandler::setUpScene(osgViewer::ViewerBase* viewer)
|
||||
{
|
||||
if ((*citr)->getGraphicsContext())
|
||||
{
|
||||
unsigned int contextID = (*citr)->getGraphicsContext()->getState()->getContextID();
|
||||
const osg::State* state = (*citr)->getGraphicsContext()->getState();
|
||||
unsigned int contextID = state->getContextID();
|
||||
const osg::Drawable::Extensions* extensions = osg::Drawable::getExtensions(contextID, false);
|
||||
if (extensions && extensions->isTimerQuerySupported())
|
||||
if (extensions &&
|
||||
(((extensions->isARBTimerQuerySupported()
|
||||
&& state->getTimestampBits() > 0))
|
||||
|| extensions->isTimerQuerySupported()))
|
||||
{
|
||||
++numCamrasWithTimerQuerySupport;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user