i965: Also copy stencil miptree data.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 20 May 2016 03:50:06 +0000 (20:50 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 25 May 2016 21:17:29 +0000 (14:17 -0700)
The Meta path handles this, but the CPU/BLT fallbacks did not.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
src/mesa/drivers/dri/i965/intel_copy_image.c

index d1145348d655536408b4ab3460a5dc7ca2b4911f..ead5b0d830c9a844bb7623ed0d914a739cc074f1 100644 (file)
@@ -314,6 +314,21 @@ intel_copy_image_sub_data(struct gl_context *ctx,
    copy_miptrees(brw, src_mt, src_x, src_y, src_z, src_level,
                  dst_mt, dst_x, dst_y, dst_z, dst_level,
                  src_width, src_height);
+
+   /* CopyImage only works for equal formats, texture view equivalence
+    * classes, and a couple special cases for compressed textures.
+    *
+    * Notably, GL_DEPTH_STENCIL does not appear in any equivalence
+    * classes, so we know the formats must be the same, and thus both
+    * will either have stencil, or not.  They can't be mismatched.
+    */
+   assert((src_mt->stencil_mt != NULL) == (dst_mt->stencil_mt != NULL));
+
+   if (dst_mt->stencil_mt) {
+      copy_miptrees(brw, src_mt->stencil_mt, src_x, src_y, src_z, src_level,
+                    dst_mt->stencil_mt, dst_x, dst_y, dst_z, dst_level,
+                    src_width, src_height);
+   }
 }
 
 void