We're recently upgrading our iOS build to Ogre 2.2 (from 2.1). Our windows build is already working, but for iOS there are some unique problems. The first one is that the are some extra files in Hlms Pbs's folder: BRDF*, BlendModes*, DetailMaps*, IrradianceVolume*, Structs*. They need to be removed, otherwise we'll get errors like
Code: Select all
Error at line 1: @piece 'PassStructDecl' already defined
Code: Select all
-[MTLDebugBlitCommandEncoder validateCopyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:options:]:239: failed assertion `destinationSlice(4) must be < (4).'
Code: Select all
__unsafe_unretained id<MTLBlitCommandEncoder> blitEncoder = device->getBlitEncoder();
for( uint32 slice=0; slice<numSlices; ++slice )
{
[blitEncoder copyFromTexture:srcTextureName
sourceSlice:srcBox.sliceStart + this->getInternalSliceStart() + slice
sourceLevel:srcMipLevel
sourceOrigin:MTLOriginMake( srcBox.x, srcBox.y, srcBox.z )
sourceSize:MTLSizeMake( srcBox.width, srcBox.height, srcBox.depth )
toTexture:dstTextureName
destinationSlice:dstBox.sliceStart + dstMetal->getInternalSliceStart() + slice
destinationLevel:dstMipLevel
destinationOrigin:MTLOriginMake( dstBox.x, dstBox.y, dstBox.z )];
}
The memory consumption is considerably lower than Ogre 2.1 (for example, one of our scenes used 1.5GB -> 900MB after upgrading), but it seems that it's easier to get killed by "memory issue". Maybe it's due to more memory fragmentation?
Another frustrating issue is that it looks like destroying scene nodes/movable objects will not free memory? I'm manually calling unloadunreferencedXXXX() function for v1/v2 mesh manager, texture manager and material manager, and I can see some resources are really unloaded (and for meshes, vaoManager->destroyVertx/IndexBuffer() is called), but the memory is not back.
One of our key functionality is to replace part of the large scene with another "sub-scene", but currently unloading the old part does free memory but loading another sub-scene increases memory
Thanks in advance.