[...] 
> > void OSG::Window::validateGLObject(UInt32 id)
> > {
> >      [...]
> >      if(_mfGlObjectLastReinitialize[id] == 0)
> >      {
> >          obj->incRefCounter();
> >          obj->getFunctor().call(this, packIdStatus(id, initialize));
> > --->    _mfGlObjectLastReinitialize[id] = 1;  <---
> >          _lastValidate[id] = getGlObjectEventCounter();
> >      }
> >      else if [...]
> > }
> > 
> > The reinitialization flags are properly synchronized if I put
> > begin/endEditCP calls around the marked line. This modification
> > fixes my problem: no more unnecessary recreations of display-
> > lists, no lags.
> > 
> > Is there a reason why the write access to the field is not
> > wrapped by begin/endEditCP calls at this place of the code?
> 
> It's probably a bug, and we should fix it. But I'm not sure why it is a
> problem, so I'd like to better understand what's going on. 
> 
> I could see it being a problem if the _mfGlObjectLastReinitialize field
> was changed in your job thread, that way the old, out of date data would
> be synchronized back into the render thread, forcing a rebuild of the
> display lists. But given that validateGLObject is only called from the
> render thread during rendering, the display thread should never have it
> in its ChangeList. Unless you do begin/endEdits on the Window without
> giving a mask, then I could see it. Do you do that? Do you know another
> reason why that field would show up in the ChangeList?

Hi Dirk,

I could not find any places in my code that involve a direct modification
of the Window by the job-thread. However, the job-thread creates new
Geometry cores, invoking osg::Geometry::onCreate(...) as a side-effect. 
This method calls 

// static 
osg::Window::registerGLObject(...) 

to assign a GL-id to the new Geometry core. This method calls 

// static
osg::Window::initRegisterGLObject(...) 

which calls

osg::Window::doInitRegisterGLObject(...)

and finally, doInitRegisterGLObject(...) edits the 
_mfGlObjectLastReinitialize field. As a consequence, this field access 
shows up in the ChangeList of the job-thread, and the out of date 
data will be applied to the aspect of the render-thread, resulting in 
a recreation of display-lists.

Best regards,

Moritz
______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!            
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to