i965: Delete the blitter path for CopyTexSubImage
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 11 May 2018 18:19:06 +0000 (11:19 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 22 May 2018 22:46:31 +0000 (15:46 -0700)
The blorp path (called first) can do anything the blitter path can do so
it's just dead code.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/intel_tex_copy.c

index 5a0e09f2551ba59bcd56616b6c8445221aaa5cfc..bc209c605bd62b9e89f9f0200a01f547035aa0e4 100644 (file)
 #include "intel_mipmap_tree.h"
 #include "intel_fbo.h"
 #include "intel_tex.h"
-#include "intel_blit.h"
 #include "brw_context.h"
 
 #define FILE_DEBUG_FLAG DEBUG_TEXTURE
 
 
-static bool
-intel_copy_texsubimage(struct brw_context *brw,
-                       struct intel_texture_image *intelImage,
-                       GLint dstx, GLint dsty, GLint slice,
-                       struct intel_renderbuffer *irb,
-                       GLint x, GLint y, GLsizei width, GLsizei height)
-{
-   const GLenum internalFormat = intelImage->base.Base.InternalFormat;
-
-   if (!intelImage->mt || !irb || !irb->mt) {
-      if (unlikely(INTEL_DEBUG & DEBUG_PERF))
-        fprintf(stderr, "%s fail %p %p (0x%08x)\n",
-                __func__, intelImage->mt, irb, internalFormat);
-      return false;
-   }
-
-   /* No pixel transfer operations (zoom, bias, mapping), just a blit */
-   if (brw->ctx._ImageTransferState)
-      return false;
-
-   intel_prepare_render(brw);
-
-   /* glCopyTexSubImage() can be called on a multisampled renderbuffer (if
-    * that renderbuffer is associated with the window system framebuffer),
-    * however the hardware blitter can't handle this case, so fall back to
-    * meta (which can, since it uses ReadPixels).
-    */
-   if (irb->Base.Base.NumSamples != 0)
-      return false;
-
-   /* glCopyTexSubImage() can't be called on a multisampled texture. */
-   assert(intelImage->base.Base.NumSamples == 0);
-
-   /* 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 */
-   return intel_miptree_blit(brw,
-                             irb->mt, irb->mt_level, irb->mt_layer,
-                             x, y, irb->Base.Base.Name == 0,
-                             intelImage->mt, dst_level, dst_slice,
-                             dstx, dsty, false,
-                             width, height, COLOR_LOGICOP_COPY);
-}
-
-
 static void
 intelCopyTexSubImage(struct gl_context *ctx, GLuint dims,
                      struct gl_texture_image *texImage,
@@ -107,14 +57,6 @@ intelCopyTexSubImage(struct gl_context *ctx, GLuint dims,
                                  xoffset, yoffset, width, height))
       return;
 
-   /* Next, try the BLT engine. */
-   if (intel_copy_texsubimage(brw,
-                              intel_texture_image(texImage),
-                              xoffset, yoffset, slice,
-                              intel_renderbuffer(rb), x, y, width, height)) {
-      return;
-   }
-
    /* Finally, fall back to meta.  This will likely be slow. */
    perf_debug("%s - fallback to swrast\n", __func__);
    _mesa_meta_CopyTexSubImage(ctx, dims, texImage,