Hi Jaap, Thanks for the fix, now merged and submitted to svn/trunk and OSG-3.2 branch. I have also add the glPixelStore lines infront of the glTexSubImage2D call.
Cheers, Robert. On 17 July 2014 13:56, Jaap Glas <[email protected]> wrote: > Dear all, > > I am an employee of dGB Earth Sciences. We have ported the 3D visualization > of our open-source seismic interpretation package OpendTect to > OpenSceneGraph. > We are currently in the bug fixing stage of the OpendTect 5.0 > beta-release. > > I want to submit a bugfix for a crash occurring in osgText/Glyph.cpp if > 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. > > QUESTION: The only thing I am wondering is whether exactly the same bugfix > should also be added in front of the call to glTexSubImage2D(.) around > line 376, where "the image is subloaded once"? > > The attached file osgText/Glyph.cpp with modifications was taken from the > OSG 3.3.1 developers release, but the same bugfix(es) should go into the > OSG 3.2 stable release too. > > > Best regards, > > Jaap Glas > > -- > -- > *dr. Jaap C. Glas* *Software Engineer* > *______________________________* > > *dGB Earth Sciences* Phone: +31 53 4315155 <+31%2053%204315155> > E-mail: [email protected] Internet: dgbes.com & opendtect.org > *______________________________* > > _______________________________________________ > osg-submissions mailing list > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > >
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
