From 873386b22d13de716b0d0b70fdf4a8acc97ae18b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 13 Feb 2012 21:12:14 +0000 Subject: Fix #30170: with file saved in texture painting mode, when going to object mode the image texture is missing. The flag to indicate that the mipmap levels were already loaded into GPU memory was incorrectly set then. --- source/blender/gpu/intern/gpu_draw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 926faeb417e..1cd79746aee 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -732,6 +732,8 @@ void GPU_paint_set_mipmap(int mipmap) else GPU_free_image(ima); } + else + ima->tpageflag &= ~IMA_MIPMAP_COMPLETE; } } @@ -742,6 +744,8 @@ void GPU_paint_set_mipmap(int mipmap) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1)); } + else + ima->tpageflag &= ~IMA_MIPMAP_COMPLETE; } } } @@ -939,7 +943,6 @@ void GPU_free_image(Image *ima) if(ima->bindcode) { glDeleteTextures(1, (GLuint *)&ima->bindcode); ima->bindcode= 0; - ima->tpageflag &= ~IMA_MIPMAP_COMPLETE; } /* free glsl image binding */ @@ -954,8 +957,9 @@ void GPU_free_image(Image *ima) MEM_freeN(ima->repbind); ima->repbind= NULL; - ima->tpageflag &= ~IMA_MIPMAP_COMPLETE; } + + ima->tpageflag &= ~IMA_MIPMAP_COMPLETE; } void GPU_free_images(void) -- cgit v1.2.3