[Mesa-dev] [PATCH v3 7/7] i965: ASTC5x5 workaround logic for blorp

Rogovin, Kevin kevin.rogovin at intel.com
Wed Mar 7 07:53:34 UTC 2018


What would be a good place for this in the blorp code? I am guessing the only time that blorp would trigger an astc read is in blitting… what would you suggest for keeping it inside of blorp? The blorp_context struct is part of blorp not i965… to keep it in blorp would mean it needs to be passed down along the function calls somehow …

-Kevin

From: Jason Ekstrand [mailto:jason at jlekstrand.net]
Sent: Tuesday, March 6, 2018 6:07 PM
To: Rogovin, Kevin <kevin.rogovin at intel.com>
Cc: ML mesa-dev <mesa-dev at lists.freedesktop.org>
Subject: Re: [Mesa-dev] [PATCH v3 7/7] i965: ASTC5x5 workaround logic for blorp

On Tue, Feb 27, 2018 at 1:30 AM, <kevin.rogovin at intel.com<mailto:kevin.rogovin at intel.com>> wrote:
From: Kevin Rogovin <kevin.rogovin at intel.com<mailto:kevin.rogovin at intel.com>>

Signed-off-by: Kevin Rogovin <kevin.rogovin at intel.com<mailto: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 062171a..b7c35e9 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 e25bc9a..38967fb 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -824,10 +824,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)

Let's keep all of the code for detecting whether or not BLORP needs and implementing it together in BLORP.  We can just as easily detect ASTC5x5 there as here.

          return;

       perf_debug("%s: fallback to CPU mapping in PBO case\n", __func__);
--
2.7.4

_______________________________________________
mesa-dev mailing list
mesa-dev at lists.freedesktop.org<mailto:mesa-dev at lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180307/72567193/attachment-0001.html>


More information about the mesa-dev mailing list