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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-04-27 18:14:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-04-27 18:18:50 +0300
commit84db9fdf4dd3bb5e1ddd6c2884787033386ac2ca (patch)
tree08add31e64e4da8d1a9c7791a202350c8709ba12 /source/blender/gpu
parent8d8d1939fab72cee068be81dac84679cac42cee6 (diff)
Fix T44464: Viewport mipmaps no longer toggle off
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index a31e90f0dfe..a24067fc381 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -239,8 +239,12 @@ static struct GPUTextureState {
int curtileYRep, tileYRep;
Image *ima, *curima;
- bool domipmap, linearmipmap;
- bool texpaint; /* store this so that new images created while texture painting won't be set to mipmapped */
+ /* also controls min/mag filtering */
+ bool domipmap;
+ /* only use when 'domipmap' is set */
+ bool linearmipmap;
+ /* store this so that new images created while texture painting won't be set to mipmapped */
+ bool texpaint;
int alphablend;
float anisotropic;
@@ -292,7 +296,6 @@ void GPU_set_mipmap(bool mipmap)
void GPU_set_linear_mipmap(bool linear)
{
if (GTS.linearmipmap != linear) {
- GPU_free_images();
GTS.linearmipmap = linear;
}
}
@@ -312,18 +315,23 @@ static GLenum gpu_get_mipmap_filter(bool mag)
/* linearmipmap is off by default *when mipmapping is off,
* use unfiltered display */
if (mag) {
- if (GTS.linearmipmap || GTS.domipmap)
+ if (GTS.domipmap)
return GL_LINEAR;
else
return GL_NEAREST;
}
else {
- if (GTS.linearmipmap)
- return GL_LINEAR_MIPMAP_LINEAR;
- else if (GTS.domipmap)
- return GL_LINEAR_MIPMAP_NEAREST;
- else
+ if (GTS.domipmap) {
+ if (GTS.linearmipmap) {
+ return GL_LINEAR_MIPMAP_LINEAR;
+ }
+ else {
+ return GL_LINEAR_MIPMAP_NEAREST;
+ }
+ }
+ else {
return GL_NEAREST;
+ }
}
}