i965: Account for view parameters in blit CTSI path
authorChris Forbes <chrisf@ijw.co.nz>
Fri, 14 Mar 2014 19:49:35 +0000 (08:49 +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/intel_tex_copy.c

index ca0b5b976c69e6452e2db3695dc80a7cbf11ea14..c2b6c350c1b07851f66d309d76c7042fff95a1ec 100644 (file)
@@ -74,12 +74,17 @@ intel_copy_texsubimage(struct brw_context *brw,
       return false;
    }
 
+   /* account for view parameters and face index */
+   int dst_level = intelImage->base.Base.Level +
+                   intelImage->base.Base.TexObject->MinLevel;
+   int dst_slice = slice + intelImage->base.Base.Face +
+                   intelImage->base.Base.TexObject->MinLayer;
+
    /* blit from src buffer to texture */
    if (!intel_miptree_blit(brw,
                            irb->mt, irb->mt_level, irb->mt_layer,
                            x, y, irb->Base.Base.Name == 0,
-                           intelImage->mt, intelImage->base.Base.Level,
-                           intelImage->base.Base.Face + slice,
+                           intelImage->mt, dst_level, dst_slice,
                            dstx, dsty, false,
                            width, height, GL_COPY)) {
       return false;