Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorEthan-Hall <Ethan1080>2022-07-19 16:20:01 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-07-19 16:20:53 +0300
commit44f1495b570037f06c698b0fb0a7cb21fdf0ac97 (patch)
tree3e51d085b2d4521fc01c8d0fd37b2f8b63c0df56 /source
parente8465f941cefe2cd408a5e9db97e9a9b3eef1d25 (diff)
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
Diffstat (limited to 'source')
-rw-r--r--source/blender/gpu/opengl/gl_texture.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_texture.cc b/source/blender/gpu/opengl/gl_texture.cc
index 055c8d104e2..cfb3184c4a5 100644
--- a/source/blender/gpu/opengl/gl_texture.cc
+++ b/source/blender/gpu/opengl/gl_texture.cc
@@ -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