From Paul Martz, "I had to make Yet Another tweak to the workaround for the occlusion query issue on NVIDIA cards. Testing indicates that this produces stable results. I checked this in to the 2.6 branch as revision 8965. Please include this on the trunk"

This commit is contained in:
Robert Osfield 2008-10-03 11:02:13 +00:00
parent 99fd6ed93a
commit 7a6ec46535

View File

@ -35,6 +35,8 @@
#include <map> #include <map>
#include <vector> #include <vector>
#include <OpenThreads/Thread>
typedef osg::buffered_value< osg::ref_ptr< osg::Drawable::Extensions > > OcclusionQueryBufferedExtensions; typedef osg::buffered_value< osg::ref_ptr< osg::Drawable::Extensions > > OcclusionQueryBufferedExtensions;
static OcclusionQueryBufferedExtensions s_OQ_bufferedExtensions; static OcclusionQueryBufferedExtensions s_OQ_bufferedExtensions;
@ -238,9 +240,13 @@ struct RetrieveQueriesCallback : public osg::Camera::DrawCallback
// work aroung issues in the device driver. For example, without this // work aroung issues in the device driver. For example, without this
// code, we've seen crashes on 64-bit Mac/Linux NVIDIA systems doing // code, we've seen crashes on 64-bit Mac/Linux NVIDIA systems doing
// multithreaded, multipipe rendering (as in a CAVE). // multithreaded, multipipe rendering (as in a CAVE).
// Tried with ATI and verified this workaround is not needed; the
// problem is specific to NVIDIA.
GLint ready( 0 ); GLint ready( 0 );
while( !ready ) while( !ready )
{ {
// Apparently, must actually sleep here to avoid issues w/ NVIDIA Quadro.
OpenThreads::Thread::microSleep( 5 );
ext->glGetQueryObjectiv( tr->_id, GL_QUERY_RESULT_AVAILABLE, &ready ); ext->glGetQueryObjectiv( tr->_id, GL_QUERY_RESULT_AVAILABLE, &ready );
}; };
#endif #endif