Mesa (9.0): st/mesa: Fix source miptree level for copying data to finalized miptree.
Andreas Boll
ab at kemper.freedesktop.org
Fri Oct 19 16:58:51 UTC 2012
Module: Mesa
Branch: 9.0
Commit: 8f772b34b0d59e369177c129a1d195917b288adf
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f772b34b0d59e369177c129a1d195917b288adf
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Fri Oct 19 11:59:35 2012 +0200
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 <michel.daenzer at amd.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev at gmail.com>
(cherry picked from commit c2e37b1d2e1b8014475c7d2698fba317c9082d70)
---
src/mesa/state_tracker/st_cb_texture.c | 6 +++++-
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 ed3bbc7..406f11a 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1130,11 +1130,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 */
More information about the mesa-commit
mailing list