Merged revisions 8795 and 8796 from trunk. This is the workaround for occlusion query on NVIDIA plus the cmake interface to enable it. Also bumped the rev to 2.6.1 in anticipation of upcoming branch release.
This commit is contained in:
@@ -269,6 +269,17 @@ IF(PKG_CONFIG_FOUND)
|
||||
|
||||
ENDIF(PKG_CONFIG_FOUND)
|
||||
|
||||
|
||||
#
|
||||
# Enable workaround for OpenGL driver crash with occlusion query
|
||||
#
|
||||
OPTION(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL "Set to ON to build OcclussionQueryNode with a workaround for multi-threaded OpenGL driver occlussion query crash. " OFF)
|
||||
IF(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
|
||||
ADD_DEFINITIONS(-DFORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
|
||||
ENDIF(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Test to determine if we want the "tripledot" form of the GLU tesselator callback.
|
||||
#
|
||||
|
||||
@@ -21,7 +21,7 @@ extern "C" {
|
||||
|
||||
#define OPENSCENEGRAPH_MAJOR_VERSION 2
|
||||
#define OPENSCENEGRAPH_MINOR_VERSION 6
|
||||
#define OPENSCENEGRAPH_PATCH_VERSION 0
|
||||
#define OPENSCENEGRAPH_PATCH_VERSION 1
|
||||
#define OPENSCENEGRAPH_SOVERSION 44
|
||||
|
||||
/**
|
||||
|
||||
@@ -232,6 +232,19 @@ struct RetrieveQueriesCallback : public osg::Camera::DrawCallback
|
||||
osg::notify( osg::DEBUG_INFO ) <<
|
||||
"osgOQ: RQCB: Retrieving..." << std::endl;
|
||||
|
||||
#ifdef FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL
|
||||
|
||||
// Should not need to do this, but is required on some platforms to
|
||||
// work aroung issues in the device driver. For example, without this
|
||||
// code, we've seen crashes on 64-bit Mac/Linux NVIDIA systems doing
|
||||
// multithreaded, multipipe rendering (as in a CAVE).
|
||||
GLint ready( 0 );
|
||||
while( !ready )
|
||||
{
|
||||
ext->glGetQueryObjectiv( tr->_id, GL_QUERY_RESULT_AVAILABLE, &ready );
|
||||
};
|
||||
#endif
|
||||
|
||||
ext->glGetQueryObjectiv( tr->_id, GL_QUERY_RESULT, &(tr->_numPixels) );
|
||||
if (tr->_numPixels < 0)
|
||||
osg::notify( osg::WARN ) << "osgOQ: RQCB: " <<
|
||||
|
||||
Reference in New Issue
Block a user