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 );