[Mesa-dev] [PATCH] intel: Fix copying of separate stencil data in glCopyTexSubImage().

Eric Anholt eric at anholt.net
Thu May 30 15:47:05 PDT 2013


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

Fixes piglit copyteximage other than 1D_ARRAY.
---
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index c3ef054..67c40a7 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -375,10 +375,16 @@ 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)
+      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;
 
       brw_blorp_blit_miptrees(intel,
-                              src_irb->mt, src_irb->mt_level, src_irb->mt_layer,
+                              src_mt, src_irb->mt_level, src_irb->mt_layer,
                               dst_mt, dst_image->Level, dst_image->Face,
                               srcX0, srcY0, dstX0, dstY0, dstX1, dstY1,
                               false, mirror_y);
-- 
1.8.3.rc0



More information about the mesa-dev mailing list