EEVEE: use mipmaps of compressed textures (DDS)

Currently Blender generates mipmaps that override the existing ones.
This patch disables generating new mipmaps for compressed textures.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14459
This commit is contained in:
Ethan-Hall 2022-07-19 15:20:01 +02:00 committed by Clément Foucault
parent e8465f941c
commit 44f1495b57
1 changed files with 6 additions and 0 deletions

View File

@ -310,6 +310,12 @@ void GLTexture::update_sub(
*/
void GLTexture::generate_mipmap()
{
/* Allow users to provide mipmaps stored in compressed textures.
* Skip generating mipmaps to avoid overriding the existing ones. */
if (format_flag_ & GPU_FORMAT_COMPRESSED) {
return;
}
/* Some drivers have bugs when using #glGenerateMipmap with depth textures (see T56789).
* In this case we just create a complete texture with mipmaps manually without
* down-sampling. You must initialize the texture levels using other methods like