aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2012-10-19 11:59:35 +0200
committerAndreas Boll <[email protected]>2012-10-19 18:59:13 +0200
commit54cc16d3d9a53ea6f6b65b69eba46ac5f6594b37 (patch)
tree34afd2ac67790b165a5c190689c3d9550912f951 /src
parentddcf624ac945537652e0a97176a7e8de72aa3092 (diff)
st/mesa: Fix source miptree level for copying data to finalized miptree.
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 <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Andreas Boll <[email protected]> (cherry picked from commit c2e37b1d2e1b8014475c7d2698fba317c9082d70)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index a8e02408890..af12856d139 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1184,11 +1184,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 */