i965: Account for MinLayer/MinLevel in blorp CTSI path
authorChris Forbes <chrisf@ijw.co.nz>
Fri, 14 Mar 2014 19:16:42 +0000 (08:16 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Thu, 10 Apr 2014 06:27:41 +0000 (18:27 +1200)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp

index 9e809359a280000d0e527769505bde6384cedc76..300ff5c42b770bcc7e6ea7ff7a3c7f5fa7d115cd 100644 (file)
@@ -402,9 +402,13 @@ brw_blorp_copytexsubimage(struct brw_context *brw,
       mirror_y = true;
    }
 
+   /* Account for face selection and texture view MinLayer */
+   int dst_slice = slice + dst_image->TexObject->MinLayer + dst_image->Face;
+   int dst_level = dst_image->Level + dst_image->TexObject->MinLevel;
+
    brw_blorp_blit_miptrees(brw,
                            src_mt, src_irb->mt_level, src_irb->mt_layer,
-                           dst_mt, dst_image->Level, dst_image->Face + slice,
+                           dst_mt, dst_level, dst_slice,
                            srcX0, srcY0, srcX1, srcY1,
                            dstX0, dstY0, dstX1, dstY1,
                            GL_NEAREST, false, mirror_y);
@@ -427,8 +431,7 @@ brw_blorp_copytexsubimage(struct brw_context *brw,
       if (src_mt != dst_mt) {
          brw_blorp_blit_miptrees(brw,
                                  src_mt, src_irb->mt_level, src_irb->mt_layer,
-                                 dst_mt, dst_image->Level,
-                                 dst_image->Face + slice,
+                                 dst_mt, dst_level, dst_slice,
                                  srcX0, srcY0, srcX1, srcY1,
                                  dstX0, dstY0, dstX1, dstY1,
                                  GL_NEAREST, false, mirror_y);