Code: Select all
Ogre::TextureGpu* texture = _ogreWindow->getTexture();
Ogre::TextureBox box( texture->getEmptyBox( 0 ) );
std::vector<unsigned char> buffer( box.getSizeBytes() );
Ogre::TextureBox dstBox( box );
dstBox.data = buffer.data();
texture->copyContentsToMemory( box, dstBox, Ogre::PFG_RGBA8_UNORM_SRGB );
Code: Select all
-[MTLDebugBlitCommandEncoder validateCopyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:options:]:851: failed assertion `sourceTexture must not be nil.'
Code: Select all
[blitEncoder copyFromTexture:srcTextureMetal->getFinalTextureName()
sourceSlice:srcTextureBox.sliceStart + i
sourceLevel:mipLevel
sourceOrigin:mtlOrigin
sourceSize:mtlSize
toBuffer:mVboName
destinationOffset:destBytesPerImage * i
destinationBytesPerRow:destBytesPerRow
destinationBytesPerImage:destBytesPerImage];