intel: Allow blorp CopyTexSubImage to nonzero destination slices.
authorEric Anholt <eric@anholt.net>
Tue, 4 Jun 2013 17:35:26 +0000 (10:35 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 17 Jun 2013 22:43:23 +0000 (15:43 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/intel/intel_tex_copy.c

index 7b063fff9226bc0ac6412c2bc8062ce9815c230f..8694128d25f6599e8244e5db32bed26965e587eb 100644 (file)
@@ -330,6 +330,7 @@ bool
 brw_blorp_copytexsubimage(struct intel_context *intel,
                           struct gl_renderbuffer *src_rb,
                           struct gl_texture_image *dst_image,
+                          int slice,
                           int srcX0, int srcY0,
                           int dstX0, int dstY0,
                           int width, int height)
@@ -354,12 +355,6 @@ brw_blorp_copytexsubimage(struct intel_context *intel,
       return false;
    }
 
-   /* We can't use blorp to copy to a 1D array texture, since it can only
-    * write to one layer of the texture at a time.
-    */
-   if (dst_mt->target == GL_TEXTURE_1D_ARRAY)
-      return false;
-
    /* Source clipping shouldn't be necessary, since copytexsubimage (in
     * src/mesa/main/teximage.c) calls _mesa_clip_copytexsubimage() which
     * takes care of it.
@@ -388,7 +383,7 @@ brw_blorp_copytexsubimage(struct intel_context *intel,
 
    brw_blorp_blit_miptrees(intel,
                            src_mt, src_irb->mt_level, src_irb->mt_layer,
-                           dst_mt, dst_image->Level, dst_image->Face,
+                           dst_mt, dst_image->Level, dst_image->Face + slice,
                            srcX0, srcY0, srcX1, srcY1,
                            dstX0, dstY0, dstX1, dstY1,
                            false, mirror_y);
@@ -411,7 +406,8 @@ brw_blorp_copytexsubimage(struct intel_context *intel,
       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,
+                                 dst_mt, dst_image->Level,
+                                 dst_image->Face + slice,
                                  srcX0, srcY0, srcX1, srcY1,
                                  dstX0, dstY0, dstX1, dstY1,
                                  false, mirror_y);
index 0db1a1802b8891d9961c107430c360338a35e8ca..f54a937cc1ecc3faa6a861f410b718b7ca34c4b9 100644 (file)
@@ -1238,6 +1238,7 @@ bool
 brw_blorp_copytexsubimage(struct intel_context *intel,
                           struct gl_renderbuffer *src_rb,
                           struct gl_texture_image *dst_image,
+                          int slice,
                           int srcX0, int srcY0,
                           int dstX0, int dstY0,
                           int width, int height);
index 9413b144d937b7554eaa4fb874e1d491c99c4c99..d018cece1cb5137294b35ed930790fcb9d5774b5 100644 (file)
@@ -102,14 +102,12 @@ intelCopyTexSubImage(struct gl_context *ctx, GLuint dims,
 {
    struct intel_context *intel = intel_context(ctx);
 
-   if (slice == 0) {
 #ifndef I915
-      /* Try BLORP first.  It can handle almost everything. */
-      if (brw_blorp_copytexsubimage(intel, rb, texImage, x, y,
-                                    xoffset, yoffset, width, height))
-         return;
+   /* Try BLORP first.  It can handle almost everything. */
+   if (brw_blorp_copytexsubimage(intel, rb, texImage, slice, x, y,
+                                 xoffset, yoffset, width, height))
+      return;
 #endif
-   }
 
    /* Next, try the BLT engine. */
    if (intel_copy_texsubimage(intel,