This patch adds a mipmaps member to the GPUTexture struct and also computes to the memory used by these mipmaps and the memory used for textures that are created from an external bindcode.
So it solves the following inconsistencies:
- The memory value for mipmaps was not being computed.
- As GPU_texture_from_bindcode didn't call gpu_texture_memory_footprint_add, it brought inconsistencies to the value of the used memory, especially when the texture is freed.
Notes:
- The bytesize member has been removed from the GPUTexture struct, as I don't think it is a good idea to increase the size of that struct with the new member mipmaps, and also because the value of bitesize is easy to obtain.
- There are around 12 other places in the blender code that creates gl textures without going through the gpu. Therefore the computed memory value is not the actual gpu memory value.