[Mesa-dev] [PATCH v2 5/5] i965: ASTC5x5 workaround logic for blorp

kevin.rogovin at intel.com kevin.rogovin at intel.com
Thu Dec 14 17:39:51 UTC 2017


From: Kevin Rogovin <kevin.rogovin at intel.com>

Signed-off-by: Kevin Rogovin <kevin.rogovin at intel.com>
---
 src/mesa/drivers/dri/i965/genX_blorp_exec.c |  5 +++++
 src/mesa/drivers/dri/i965/intel_tex_image.c | 16 ++++++++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/genX_blorp_exec.c b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
index e8bc52e..97791b7 100644
--- a/src/mesa/drivers/dri/i965/genX_blorp_exec.c
+++ b/src/mesa/drivers/dri/i965/genX_blorp_exec.c
@@ -230,6 +230,11 @@ genX(blorp_exec)(struct blorp_batch *batch,
    struct gl_context *ctx = &brw->ctx;
    bool check_aperture_failed_once = false;
 
+   if (brw->astc5x5_wa.blorp_sampling_from_astc5x5) {
+      gen9_set_astc5x5_wa_mode(brw, BRW_ASTC5x5_WA_MODE_HAS_ASTC5x5);
+   } else {
+      gen9_set_astc5x5_wa_mode(brw, BRW_ASTC5x5_WA_MODE_HAS_AUX);
+   }
    /* Flush the sampler and render caches.  We definitely need to flush the
     * sampler cache so that we get updated contents from the render cache for
     * the glBlitFramebuffer() source.  Also, we are sometimes warned in the
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index 37c8e24..60028bb 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -759,10 +759,18 @@ intel_get_tex_sub_image(struct gl_context *ctx,
    DBG("%s\n", __func__);
 
    if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
-      if (intel_gettexsubimage_blorp(brw, texImage,
-                                     xoffset, yoffset, zoffset,
-                                     width, height, depth, format, type,
-                                     pixels, &ctx->Pack))
+      bool blorp_success;
+
+      brw->astc5x5_wa.blorp_sampling_from_astc5x5 =
+         (texImage->TexFormat == MESA_FORMAT_RGBA_ASTC_5x5 ||
+          texImage->TexFormat == MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5);
+      blorp_success = intel_gettexsubimage_blorp(brw, texImage,
+                                                 xoffset, yoffset, zoffset,
+                                                 width, height, depth,
+                                                 format, type, pixels,
+                                                 &ctx->Pack);
+      brw->astc5x5_wa.blorp_sampling_from_astc5x5 = false;
+      if (blorp_success)
          return;
 
       perf_debug("%s: fallback to CPU mapping in PBO case\n", __func__);
-- 
2.7.4



More information about the mesa-dev mailing list