In DatabasePager.cpp I believe there's a copy-paste ommission. A little bit
further down the file where the Drawables are compiled the code is similar to
how I have fixed the code here for the StateSets. If the DatabasePager thread
is supposed to pre-compile things, it will call the compileGLObjects such that
compileAll will be true. However, when compiling StateSets compileAll isn't
currently checked.
Code:
1982 while (databaseRequest.valid() && (compileAll ||
(elapsedTime<availableTime &&
numObjectsCompiled<_maximumNumOfObjectsToCompilePerFrame)) )
1983 {
1984 DataToCompileMap& dcm = databaseRequest->_dataToCompileMap;
1985 DataToCompile& dtc = dcm[state.getContextID()];
1986 if (!dtc.first.empty() &&
(elapsedTime+estimatedTextureDuration)<availableTime &&
numObjectsCompiled<_maximumNumOfObjectsToCompilePerFrame)
1987 {
1988
1989 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY,
1.0);
1990
1991 // we have StateSet's to compile
1992 StateSetList& sslist = dtc.first;
1993 //osg::notify(osg::INFO)<<"Compiling
statesets"<<std::endl;
1994 StateSetList::iterator itr=sslist.begin();
1995 unsigned int objTemp = numObjectsCompiled;
1996 for(;
1997 itr!=sslist.end() &&
(elapsedTime+estimatedTextureDuration)<availableTime &&
numObjectsCompiled<_maximumNumOfObjectsToCompilePerFrame;
1998 ++itr)
1999 {
should be
Code:
1982 while (databaseRequest.valid() && (compileAll ||
(elapsedTime<availableTime &&
numObjectsCompiled<_maximumNumOfObjectsToCompilePerFrame)) )
1983 {
1984 DataToCompileMap& dcm = databaseRequest->_dataToCompileMap;
1985 DataToCompile& dtc = dcm[state.getContextID()];
// Fix on the next line
1986 if (!dtc.first.empty() && (compileAll ||
((elapsedTime+estimatedTextureDuration)<availableTime &&
numObjectsCompiled<_maximumNumOfObjectsToCompilePerFrame)))
1987 {
1988
1989 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_PRIORITY,
1.0);
1990
1991 // we have StateSet's to compile
1992 StateSetList& sslist = dtc.first;
1993 //osg::notify(osg::INFO)<<"Compiling
statesets"<<std::endl;
1994 StateSetList::iterator itr=sslist.begin();
1995 unsigned int objTemp = numObjectsCompiled;
1996 for(;
// Fix on the next line
1997 itr!=sslist.end() && (compileAll ||
((elapsedTime+estimatedTextureDuration)<availableTime &&
numObjectsCompiled<_maximumNumOfObjectsToCompilePerFrame));
1998 ++itr)
1999 {
------------------
Read this topic online here:
http://osgforum.tevs.eu/viewtopic.php?p=4999#4999
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org