Module: Mesa
Branch: master
Commit: bb525f1f1154f8ffde0e4199909466acbbb3876c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bb525f1f1154f8ffde0e4199909466acbbb3876c

Author: Eric Anholt <[email protected]>
Date:   Thu May 30 14:20:04 2013 -0700

intel: Fix copying of separate stencil data in glCopyTexSubImage().

We were copying the source stencil data onto the destination depth data.

Fixes piglit copyteximage other than 1D_ARRAY.

v2: Fix unintentional dropping of the "don't double-copy for packed
    depth/stencil" check.  While blorp is only supported on separate
    stencil hardware at the moment, hopefully that will change soon.
    Review by Jordan.

Reviewed-by: Jordan Justen <[email protected]>

---

 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp 
b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 0a9aca8..c70dc22 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -388,14 +388,21 @@ brw_blorp_copytexsubimage(struct intel_context *intel,
    if (_mesa_get_format_bits(dst_image->TexFormat, GL_STENCIL_BITS) > 0 &&
        src_rb != NULL) {
       src_irb = intel_renderbuffer(src_rb);
-      if (src_irb->mt != src_mt)
-
-      brw_blorp_blit_miptrees(intel,
-                              src_irb->mt, src_irb->mt_level, 
src_irb->mt_layer,
-                              dst_mt, dst_image->Level, dst_image->Face,
-                              srcX0, srcY0, srcX1, srcY1,
-                              dstX0, dstY0, dstX1, dstY1,
-                              false, mirror_y);
+      src_mt = src_irb->mt;
+
+      if (src_mt->stencil_mt)
+         src_mt = src_mt->stencil_mt;
+      if (dst_mt->stencil_mt)
+         dst_mt = dst_mt->stencil_mt;
+
+      if (src_mt != dst_mt) {
+         brw_blorp_blit_miptrees(intel,
+                                 src_mt, src_irb->mt_level, src_irb->mt_layer,
+                                 dst_mt, dst_image->Level, dst_image->Face,
+                                 srcX0, srcY0, srcX1, srcY1,
+                                 dstX0, dstY0, dstX1, dstY1,
+                                 false, mirror_y);
+      }
    }
 
    return true;

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to