FTexture2DMipMap: it's BulkData has the wrong size

Hello,

I have a 64x64 BGRA8 FTexture2DMipMipmap (level 2, level 0 is 256x256), which should be 16384 bytes but it’s BulkData size is 65535 bytes. Can I assume this is OK and I can just ignore the extra bytes?

Are all of your import settings correct in the texture?

Here are the settings:

When I check the texture’s PlatformData and Mips[2] in debug:
MipMap->SizeX = 64, MipMap->SizeY = 64, MipMap->SizeZ = 1. The texture is 256x256 in EPixelFormat::PF_B8G8R8A8.

I don’t know enough about textures to know if the bulkdata should be based on the source texture or not - apologies - You may want to try asking in the content/textures section of the forum

I got into a similar issue where calling Texture->PlatformData->Mips[0].BulkData.GetBulkDataSize() was returning a different size compared to Texture->Source.GetMipData

I solved it thanks to the below article.

The solution was to temporary set the following before i was doing the BulkData.Lock()

Texture->CompressionSettings = TextureCompressionSettings::TC_VectorDisplacementmap;
Texture->MipGenSettings = TextureMipGenSettings::TMGS_NoMipmaps;
Texture->SRGB = false;

Another fun side effect is if your image is grayscale, it can store it as G8 internally even though you set it to RGB.