[osg-users] may be some bug in dds plugin

David Spilling david.spilling at gmail.com
Tue Sep 25 03:36:18 PDT 2007

Just to add my 2p, the changes I submitted would only be seen as colour
changes (red/blue swap) on dds write; I didn't do anything with regard to
file sizes.

The image is DXT1 encoded, and includes 6 levels of mipmap. I had a quick
look, and it's falling over in the osgImage.release() method at the end of
the ReadDDSFile method - in particular, the destructor for the mipmaps
vector. My debugging skills are pretty primitive, but heres a stack trace in
case it helps anybody:

     msvcr71d.dll!_free_dbg_lk(void * pUserData=0x00239f20, int
nBlockUse=1)  Line 1154 + 0x3b    C
     msvcr71d.dll!_free_dbg(void * pUserData=0x00239f20, int nBlockUse=1)
Line 1070 + 0xd    C
     msvcr71d.dll!operator delete(void * pUserData=0x00239f20)  Line 54 +
0x10    C++
     osgdb_ddsd.dll!std::allocator<unsigned int>::deallocate(unsigned int *
_Ptr=0x00239f20, unsigned int __formal=6)  Line 132 + 0x9    C++
     osgdb_ddsd.dll!std::vector<unsigned int,std::allocator<unsigned int>
>::_Tidy()  Line 797    C++
     osgdb_ddsd.dll!std::vector<unsigned int,std::allocator<unsigned int>
>::~vector<unsigned int,std::allocator<unsigned int> >()  Line 389    C++
osgdb_ddsd.dll!ReadDDSFile(std::basic_istream<char,std::char_traits<char> >
& _istream={...})  Line 696 + 0x20    C++

> & fin={...}, const osgDB::ReaderWriter::Options * options=0x00000000)
Line 959 + 0x9    C++
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &

I also generated a similarly DXT1 encoded DDS from scratch, with various
levels of mipmap, with and without alpha, and it loaded and displayed fine.
Plus the original (unmipmapped image) should be 2048 bytes (64 x 64, DXT1 =
1 byte per 2 pixels); this and the relative mipmap data positioning, and
total size, of your image, seems OK.

So I'm lost - sorry.

The image is DXT1 encoded; perhaps try writing it uncompressed?

This doesn't help you, but I have noticed that many 3rd party DDS viewing
apps are inconsistent with regards to how they interpret DDS images, so it's
sometimes worth checking a few apps. XnView seems to read the image fine;
ATI's DDS reader (Compressonator) can't read it at all.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070925/d11943d1/attachment-0003.htm>

More information about the osg-users mailing list