OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

DatabasePager doPreCompile fix


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission
View previous topic :: View next topic  
Author Message
RickAppleton
Newbie


Joined: 15 Jan 2009
Posts: 14

PostPosted: Fri Jan 23, 2009 4:28 pm    Post subject:
DatabasePager doPreCompile fix
Reply with quote

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                    {
Back to top
View user's profile Send private message
Robert Osfield
Guest





PostPosted: Fri Jan 23, 2009 4:48 pm    Post subject:
DatabasePager doPreCompile fix
Reply with quote

Hi Rick,

I'm afraid copy and past in emails is not a reliable way to spot
changes, could you please post the whole modified file.

Also could you note which version of the OSG you've based your changes
on as the pager has seen quite a few changes over since the last
stable release.

Cheers,
Robert.

On Fri, Jan 23, 2009 at 4:28 PM, Rick Appleton
<> wrote:
Quote:
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









------------------
Post generated by Mail2Forum
Back to top
RickAppleton
Newbie


Joined: 15 Jan 2009
Posts: 14

PostPosted: Mon Jan 26, 2009 9:00 am    Post subject:
Reply with quote

Hi Robert,

We're currently quite far from the head, with multiple in progress changes even compared to the version we took so the actual file attached will contain many changes.

I've verified this fix is still needed in the HEAD of the OpenSceneGraph trunk though.

Kind regards,
Rick
Back to top
View user's profile Send private message
Robert Osfield
Guest





PostPosted: Mon Jan 26, 2009 10:29 am    Post subject:
DatabasePager doPreCompile fix
Reply with quote

Thanks Rick, line change looks appropriate and is now merged and
submitted to svn/trunk.

On Mon, Jan 26, 2009 at 9:00 AM, Rick Appleton
<> wrote:
Quote:
Hi Robert,

We're currently quite far from the head, with multiple in progress changes even compared to the version we took so the actual file attached will contain many changes.

I've verified this fix is still needed in the HEAD of the OpenSceneGraph trunk though.

Kind regards,
Rick

------------------
Read this topic online here:
http://osgforum.tevs.eu/viewtopic.php?p=5121#5121









------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Submission All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts get some "std::bad_alloc" e... surveyors General 3 Tue Apr 24, 2018 10:56 am View latest post
No new posts get std::bad_alloc exception in Datab... surveyors General 0 Mon Apr 02, 2018 4:30 am View latest post
No new posts DatabasePager::DatabaseThread is cras... hartwigw General 11 Sat Mar 24, 2018 1:53 pm View latest post
No new posts DatabasePager insights Trajce Nikolov NICK General 1 Tue Feb 13, 2018 4:15 am View latest post
No new posts Crash in ReaderWriterCURL::readFile w... hartwigw General 3 Sun Dec 17, 2017 11:46 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP