From c2e37b1d2e1b8014475c7d2698fba317c9082d70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Fri, 19 Oct 2012 11:59:35 +0200 Subject: [PATCH] st/mesa: Fix source miptree level for copying data to finalized miptree. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes WebGL texture mips conformance test, no piglit regressions. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44912 NOTE: This is a candidate for the stable branches. Signed-off-by: Michel Dänzer Reviewed-by: Brian Paul Tested-by: Andreas Boll --- src/mesa/state_tracker/st_cb_texture.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 218c8d1e375..b19dc67bfbb 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1113,11 +1113,15 @@ copy_image_data_to_texture(struct st_context *st, /* Copy potentially with the blitter: */ GLuint src_level; - if (stImage->pt != stObj->pt) + if (stImage->pt->last_level == 0) src_level = 0; else src_level = stImage->base.Level; + assert(src_level <= stImage->pt->last_level); + assert(u_minify(stImage->pt->width0, src_level) == stImage->base.Width); + assert(u_minify(stImage->pt->height0, src_level) == stImage->base.Height); + st_texture_image_copy(st->pipe, stObj->pt, dstLevel, /* dest texture, level */ stImage->pt, src_level, /* src texture, level */ -- 2.30.2