qt/qml: disable mipmapping in delegates
Mipmapping makes it possible to provide high quality scaling down images. However, it comes with high cost:
- Mipmapped images are not used in texture atlas, which breaks batching in rendering backend.
- Increased creation time.
- Increased video memory usage.
- Increased rendering time.
In delegates, this is especially important because they are constantly deleted or reused or moved around. This affects the scrolling performance.
When mipmapping is disabled, Image
tries to use the atlas instead of storing it separately if the image is not large enough. The threshold is defined internally.
Benefits of Texture atlas: (https://en.wikipedia.org/wiki/Texture_atlas)
In an application where many small textures are used frequently, it is often more efficient to store the textures in a texture atlas which is treated as a single unit by the graphics hardware. This reduces the overhead of a context switch by increasing memory locality. Careful alignment may be needed to avoid bleeding between sub textures when used with mipmapping and texture compression.
In this merge request:
- I added an advanced option to enable mipmapping in delegates. By default, it is turned off.
- Mipmapping is not used in RoundImage, so I just set TextureCanUseAtlas flag.
As a note, QSG_ATLAS_OVERLAY
environment variable can be used to see atlas textures.