From 36094af7a39465dfa57d28f799499b9f556038c3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 8 Apr 2013 15:39:38 +0000 Subject: Fix #34908: compressed DDS files did not display properly when their mipmap levels did not go down to 1x1 image size, need to set GL_TEXTURE_MAX_LEVEL then. --- source/blender/gpu/intern/gpu_draw.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index c78961e6308..e95bcab5f03 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -794,6 +794,9 @@ int GPU_upload_dxt_texture(ImBuf *ibuf) height >>= 1; } + /* set number of mipmap levels we have, needed in case they don't go down to 1x1 */ + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, i-1); + return TRUE; #else (void)ibuf; -- cgit v1.2.3