The State::AppliedProgramObjectSet wasn't ever being used actively in the current rev of the OSG so populating and clearing was no longer neccessary, allowing the code to be removed completely.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14377 16af8721-9629-0410-8352-f15c8da7e697
pushModelViewMatrix or pushProjectionMatrix will already keep the
reference when adding it to the MatrixStack. In CullVisitor::apply
methods for the billboard and the camera you already take a pointer
instead of a ref_ptr."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14375 16af8721-9629-0410-8352-f15c8da7e697
the scene tree contains (large) 2D textures from images with STRIDE.
============================================================================
#0 0x00007fffe8ea4350 in __memmove_ssse3 () from /lib64/libc.so.6
#1 0x00007fffe52ced76 in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#2 0x00007fffe52d8e86 in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#3 0x00007fffe53dd8be in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#4 0x00007fffe53c2643 in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#5 0x00007fffe53c7fdd in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#6 0x00007fffe53cbabf in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#7 0x00007fffe53cc1fa in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#8 0x00007ffff30092fd in osgText::GlyphTexture::apply (this=0x1bb8cf0, state=
...)
at /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/src/osgText/Glyph.cpp:234
#9 0x00007ffff56c30b6 in osg::State::applyAttributeOnTexUnit (this=0x125f180,
unit=0, attribute=0x1bb8cf0, as=...)
at /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/include/osg/State:1713
#10 0x00007ffff56c2f3f in osg::State::applyTextureAttribute (this=0x125f180,
unit=0, attribute=0x1bb8cf0)
at /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/include/osg/State:411
#11 0x00007ffff30204da in osgText::Text::drawTextWithBackdrop (this=0x1baed70,
state=..., colorMultiplier=...)
==============================================================================
The crash disappears if I either (1) disable the use of images with stride
in the (public) osgGeo-library, or (2) add the following bugfix to Glyph.cpp.
This combination gives me the confidence that I understand where this problem
originates from, without trying to understand the full OpenGL details.
===============================================================================
@@ -221,7 +223,12 @@
imageData[i] = 0;
}
+ glPixelStorei(GL_UNPACK_ALIGNMENT,1);
+ #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
+ glPixelStorei(GL_UNPACK_ROW_LENGTH,getTextureWidth());
+ #endif
+
// allocate the texture memory.
glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA,
getTextureWidth(), getTextureHeight(), 0,
================================================================================
I have copied (and adapted) the added lines above from the same source file,
where they were used in front of a similar call to glTexSubImage2D(.) around
line 515.
"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14372 16af8721-9629-0410-8352-f15c8da7e697
The warning is (14 times):
include\osgViewer/ViewerEventHandlers(542): warning C4250: 'osgViewer::InteractiveImageHandler' : inherits 'osgGA::EventHandler::osgGA::EventHandler::run' via dominance (src\osgViewer\StatsHandler.cpp)
include\osgGA/EventHandler(45) : see declaration of 'osgGA::EventHandler::run'
attached a zipped version of include\osgViewer\ViewerEventHandlers"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14343 16af8721-9629-0410-8352-f15c8da7e697
databasePager->setUpThreads(16, 1);
We experienced problems with multiple databasepagers loading files in parallel, when two threads start to load the same file (usually a texture referenced by multiple models). The second thread to add the file to the cache (sometimes) manages to do so while the refcount from the cached object still is zero, causing the object loaded to be destroyed.
Sometimes the second thread manages to ref() the object before Referenced::signalObserversAndDelete does the final recount check, causing a warning:
"Warning Referenced::signalObserversAndDelete(,,) doing delete with _refCount=1"
With a deleted object added to the scenegraph we get some undesired results, I think the program only crashes if the object was a Node, and just has some untextured surfaces if it was a texture, but I'm not completely sure.
Attached is a modified version of the Registry.cpp, returning the object in cache and let the duplicate loaded object to be destroyed.
A more efficient option would be to add some sort of blocking entry to the objectcache to stop the second thread from reading the file, and just wait until the first thread added it to the cache. If you think that's worthwile we would be happy to implement that version. A bit tricky to implement and test, that's why I submit a simple version that stops my program from crashing."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14300 16af8721-9629-0410-8352-f15c8da7e697