Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/opengl/gl_texture.cc
| Show First 20 Lines • Show All 306 Lines • ▼ Show 20 Lines | |||||
| /** | /** | ||||
| * This will create the mipmap images and populate them with filtered data from base level. | * This will create the mipmap images and populate them with filtered data from base level. | ||||
| * | * | ||||
| * WARNING: Depth textures are not populated but they have their mips correctly defined. | * WARNING: Depth textures are not populated but they have their mips correctly defined. | ||||
| * WARNING: This resets the mipmap range. | * WARNING: This resets the mipmap range. | ||||
| */ | */ | ||||
| void GLTexture::generate_mipmap() | 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). | /* 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 | * 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 | * down-sampling. You must initialize the texture levels using other methods like | ||||
| * #GPU_framebuffer_recursive_downsample(). */ | * #GPU_framebuffer_recursive_downsample(). */ | ||||
| if (format_flag_ & GPU_FORMAT_DEPTH) { | if (format_flag_ & GPU_FORMAT_DEPTH) { | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 415 Lines • Show Last 20 Lines | |||||