diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-05 15:46:13 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-05 15:46:13 +0400 |
commit | 5bb576e8e4cc3582ae4f5e9c1d50b073ac5f10e2 (patch) | |
tree | 303a981ad7f76e446ed864adb58ea9e2ec8999b8 /source/blender/gpu | |
parent | 690359eb8d91b34405f3188632d891fc29fe5164 (diff) |
Fix #33417: add back GPU Mipmap Generation option, apparently with this disabled
it takes up less memory on some cards, still unclear why.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_draw.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index 5f6eb45ad70..b26c25558c3 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -116,7 +116,7 @@ void GPU_set_anisotropic(float value); float GPU_get_anisotropic(void); /* enable gpu mipmapping */ -void GPU_set_gpu_mipmapping(void); +void GPU_set_gpu_mipmapping(int gpu_mipmap); /* Image updates and free * - these deal with images bound as opengl textures */ diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index bcdbfe781f8..d466e59452b 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -240,10 +240,16 @@ static struct GPUTextureState { /* Mipmap settings */ -void GPU_set_gpu_mipmapping() +void GPU_set_gpu_mipmapping(int gpu_mipmap) { - /* always enable if it's supported */ - GTS.gpu_mipmap = GLEW_EXT_framebuffer_object; + int old_value = GTS.gpu_mipmap; + + /* only actually enable if it's supported */ + GTS.gpu_mipmap = gpu_mipmap && GLEW_EXT_framebuffer_object; + + if (old_value != GTS.gpu_mipmap) { + GPU_free_images(); + } } void GPU_set_mipmap(int mipmap) |