Hi,
I'm checking the newest terra version and having crashes.
I found out the following:
I'm creating a blendweight staging texture via:
Code: Select all
m_blendWeightStagingTexture = textureManager->getStagingTexture(image.getWidth(), image.getHeight(), 1u, 1u, image.getPixelFormat());
The image has a width and height of 1024.
BUT
After the m_blendWeightStagingTexture has been creating it has suddenly a width and height of 2048, which causes ugly crashes in further code.
I Found out that in the OgreTextureGPUManager in:
Code: Select all
StagingTexture *TextureGpuManager::getStagingTexture( uint32 width, uint32 height, uint32 depth,
uint32 slices, PixelFormatGpu pixelFormat,
size_t minConsumptionRatioThreshold )
{
...
while( itor != endt )
{
StagingTexture *stagingTexture = *itor;
if( stagingTexture->supportsFormat( width, height, depth, slices, pixelFormat ) &&
( bestCandidate == endt || stagingTexture->isSmallerThan( *bestCandidate ) ) )
{
if( !stagingTexture->uploadWillStall() )
bestCandidate = itor;
}
++itor;
}
}
I hat a good canidated , which had the correct resolution, but in the code above, a new bestCandidate is set, which has now the resolution of 2048x2048. That seems no right, I thing the resolution must be taken into account.
My solution for now is, calling the staging texture twice^^, and no candidate can be found, hence a new staging texture is created with the correct resolution.
Code: Select all
if (nullptr == m_blendWeightStagingTexture)
{
m_blendWeightStagingTexture = textureManager->getStagingTexture(image.getWidth(), image.getHeight(), 1u, 1u, image.getPixelFormat());
m_blendWeightStagingTexture = textureManager->getStagingTexture(image.getWidth(), image.getHeight(), 1u, 1u, image.getPixelFormat());
}
Best Regards
Lax