Mesa (master): i965: Use blorp instead of meta for PBO texture downloads

Kenneth Graunke kwg at kemper.freedesktop.org
Fri Oct 13 04:44:56 UTC 2017


Module: Mesa
Branch: master
Commit: f933ef00e18ba4a81280d2da0f1b1ed01b387c96
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f933ef00e18ba4a81280d2da0f1b1ed01b387c96

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue Jun  6 09:58:23 2017 -0700

i965: Use blorp instead of meta for PBO texture downloads

Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/intel_tex_image.c | 33 +++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index ab3a4fb061..e4d3f12038 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -570,6 +570,31 @@ intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
    intel_miptree_release(&mt);
 }
 
+static bool
+intel_gettexsubimage_blorp(struct brw_context *brw,
+                           struct gl_texture_image *tex_image,
+                           unsigned x, unsigned y, unsigned z,
+                           unsigned width, unsigned height, unsigned depth,
+                           GLenum format, GLenum type, const void *pixels,
+                           const struct gl_pixelstore_attrib *packing)
+{
+   struct intel_texture_image *intel_image = intel_texture_image(tex_image);
+   const unsigned mt_level = tex_image->Level + tex_image->TexObject->MinLevel;
+   const unsigned mt_z = tex_image->TexObject->MinLayer + tex_image->Face + z;
+
+   /* The blorp path can't understand crazy format hackery */
+   if (_mesa_base_tex_format(&brw->ctx, tex_image->InternalFormat) !=
+       _mesa_get_format_base_format(tex_image->TexFormat))
+      return false;
+
+   return brw_blorp_download_miptree(brw, intel_image->mt,
+                                     tex_image->TexFormat, SWIZZLE_XYZW,
+                                     mt_level, x, y, mt_z,
+                                     width, height, depth,
+                                     tex_image->TexObject->Target,
+                                     format, type, false, pixels, packing);
+}
+
 /**
  * \brief A fast path for glGetTexImage.
  *
@@ -719,10 +744,10 @@ intel_get_tex_sub_image(struct gl_context *ctx,
    DBG("%s\n", __func__);
 
    if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
-      if (_mesa_meta_pbo_GetTexSubImage(ctx, 3, texImage,
-                                        xoffset, yoffset, zoffset,
-                                        width, height, depth, format, type,
-                                        pixels, &ctx->Pack)) {
+      if (intel_gettexsubimage_blorp(brw, texImage,
+                                     xoffset, yoffset, zoffset,
+                                     width, height, depth, format, type,
+                                     pixels, &ctx->Pack)) {
          /* Flush to guarantee coherency between the render cache and other
           * caches the PBO could potentially be bound to after this point.
           * See the related comment in intelReadPixels() for a more detailed




More information about the mesa-commit mailing list