Hello Johannes, On 02/28/2012 03:14 AM, Johannes Brunen wrote: > I did run into an infinite loop in ShaderCacheTreeV3::sub method. I have > no clue what is actually happening, therefore I will just outline my > setup. I have build a scene graph with some of the geometry cores shared > by different material branches. The materials I use fall into two > groups. The first one is just a classical OpenGL material, nothing fancy > there. The second one is a ShaderProgram material with a vertex, > geometry and fragment shader responsible for rendering the silhouettes > of the geometry. The ShaderProgram chunks are shared among all of the > materials in the second group.
FWIW that sounds reasonable to me. > Overall this setup works quite well, but > sometimes my application freezes. As it turned out it is hanging in the > following snipped of OpenSG code: > > OSGShaderCacheTree.inl : 3255 To be honest, I'm still hoping Gerrit will chime in on this since he is the only one who knows how the ShaderCaches work :( Since you've found that it runs into an infinite loop, somehow pCurrNode->_pNext must end up pointing to itself (or possibly another predecessor). I can see at least one theoretical code path through ShaderCacheTreeV3<>::add() where _pPrev,_pNext are not initialized, but then I'd expect a crash from a NULL deref not an infinite loop. >> From the application prespective, I did delete one of my solid bodies, > i.e. destroyed the associated scene graph parent node with the two > branches responsible for rendering the opaque faces and the silhouettes. > However, not every deletion operation leads to the hanging. > > Any idea how I can track this problem? One thing that may help is if you could produce dumps of the ShaderCache right removing an object from your scene - using Window::getShaderCache()->dump(). If you are on Windows you may want to patch OSGShaderCache.cpp:371 to dump to a path different from "/tmp/exetree.dot" though ;) If you could post the generated .dot file, hopefully I can find out how the data structure is broken and track the place where it happens from there. Cheers, Carsten ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users