[2.1] blitToMemory() triggering assert

Problems building or running the engine, queries about how to use features etc.
Post Reply
JuBe
Gnoblar
Posts: 24
Joined: Wed Jan 10, 2007 2:45 pm
x 1

[2.1] blitToMemory() triggering assert

Post by JuBe »

Hi,

I'm trying to read data of a texture using HardwarePixelBuffer::blitToMemory(), but its triggering assert in D3D11Texture::getResolveTextureResource() because mpResolveTexture isn't set. If I skip this assert everything seems to be working.

At current state you can only use blitToMemory() function when MSAA is used and this is probably a bug?

Here's a code that will trigger the assert if MSAA is not used.

Code: Select all

Ogre::TextureManager& textureMgr = Ogre::TextureManager::getSingleton();
Ogre::TexturePtr tex = textureMgr.load( "SomeImage.png", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 0 );

float* buffer = new float[tex->getBuffer()->getSizeInBytes() / sizeof( float )];
Ogre::PixelBox* pixelBox = new Ogre::PixelBox( tex->getWidth(), tex->getHeight(), tex->getDepth(), tex->getFormat(), buffer );
tex->getBuffer()->blitToMemory( *pixelBox );
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5299
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1280
Contact:

Re: [2.1] blitToMemory() triggering assert

Post by dark_sylinc »

Fixed. Thanks for the easy repro.
Post Reply