nvd3dum.dll crash, ogre 1.7.2 to 1.9.0

Problems building or running the engine, queries about how to use features etc.
Post Reply
trioAL
Gnoblar
Posts: 7
Joined: Wed Jun 11, 2014 8:34 pm

nvd3dum.dll crash, ogre 1.7.2 to 1.9.0

Post by trioAL »

I'm upgrading my project with the new version of ogre, I built Ogre 1.9.0 myself

The project compile fine with the new Ogre, but I get an error during execution :
Unhandled exception at 0x6C69AA00 (nvd3dum.dll) in myProject.exe: 0xC0000005: Access violation reading location 0xAC49652D.

My video processing

Code: Select all

Util::Bitmap* dest = mVideoTextureVector[index]->lock();

/*
     ... Skipped code, basically I blitz my texture, i put this part of code in comments, the error is still trowing
     Util::BitmapProcessing::blit24BitsTo32BitsWithTransparency(mWidth, mHeight, sourceBaseAdress, sourceBaseAdressStep, destBaseAdress, destBaseAdressStep, mTransparencyColor, mHorizontalFlip);
*/
			
mVideoTextureVector[index]->unlock();
The lock

Code: Select all

Util::Bitmap* OgreTexture::lock (void)
{
	mPixelBuffer = mTexture->getBuffer();

	mPixelBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD);
	const Ogre::PixelBox& pixelBox = mPixelBuffer->getCurrentLock();
	
	if (mBitmap)
	{
		delete mBitmap;
		mBitmap = NULL;
	}

	if (pixelBox.data)
	{
		mBitmap = new Util::Bitmap(reinterpret_cast<char *>(pixelBox.data), pixelBox.getWidth(), pixelBox.getHeight(),
			(pixelBox.getWidth() * 4) + (static_cast<int>(pixelBox.getRowSkip()) * 4), 32);
	}
		
	return mBitmap;
}
It is hard to debug in multithreading. I read the OGRE 1.9.0 Ghadamon Notes, trying to figure out what change make my code break. I'm open to any ideas.
trioAL
Gnoblar
Posts: 7
Joined: Wed Jun 11, 2014 8:34 pm

Re: nvd3dum.dll crash, ogre 1.7.2 to 1.9.0

Post by trioAL »

1st and last bump
KnightPista
Gnoblar
Posts: 10
Joined: Tue Jun 24, 2014 9:16 am
x 2

Re: nvd3dum.dll crash, ogre 1.7.2 to 1.9.0

Post by KnightPista »

Which rendering subsystem are you using?

I'm using both DX9 and DX11, and found that pixelBox.rowPitch is giving me wrong value (with the same texture). On DX9, the rowPitch is returning number of elements, but on DX11 it is returning number of bytes. Texture creation is the same for both renderers, so on DX11 I am just not multiplying rowPitch with 4 (getNumElemBytes(format)) as I get access violation reading... Something like you get...

So maybe, in your lock() try to modify that multiply by 4... just a guess...
trioAL
Gnoblar
Posts: 7
Joined: Wed Jun 11, 2014 8:34 pm

Re: nvd3dum.dll crash, ogre 1.7.2 to 1.9.0

Post by trioAL »

DX9
trioAL
Gnoblar
Posts: 7
Joined: Wed Jun 11, 2014 8:34 pm

Re: nvd3dum.dll crash, ogre 1.7.2 to 1.9.0

Post by trioAL »

Any call to HardwareBuffer::lock/unlock will just crash. I found similar case that might help me.

"In my case, I think I need OGRE_CONFIG_THREADS 1. We use the DirectX 9 render system and I saw while reading through the code that the critical section are there only with OGRE_CONFIG_THREADS set to 1. The reason we need these critical section is because we have a module that allows to play a movie file and the frame result we receive from a background thread is written directly in an Ogre::Texture."
http://www.ogre3d.org/forums/viewtopic.php?f=2&t=54953

I will try to set OGRE_CONFIG_THREADS to 1.
trioAL
Gnoblar
Posts: 7
Joined: Wed Jun 11, 2014 8:34 pm

Re: nvd3dum.dll crash, ogre 1.7.2 to 1.9.0

Post by trioAL »

OGRE_CONFIG_THREADS set to 1. Problem solved.
Post Reply