Mesa (main): turnip: Always use GMEM for feedback loops in autotuner

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 23 11:54:17 UTC 2022


Module: Mesa
Branch: main
Commit: 7e703e4428c096fcf12019ba0f4f75940c1fa1f4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e703e4428c096fcf12019ba0f4f75940c1fa1f4

Author: Danylo Piliaiev <dpiliaiev at igalia.com>
Date:   Thu Feb 17 17:02:06 2022 +0200

turnip: Always use GMEM for feedback loops in autotuner

For ordinary feedback loops GMEM is a lot faster than sysmem since
we don't set SINGLE_PRIM mode.

For feedback loops with ordered rasterization GMEM should also be
faster.

Signed-off-by: Danylo Piliaiev <dpiliaiev at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15106>

---

 src/freedreno/vulkan/tu_autotune.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/freedreno/vulkan/tu_autotune.c b/src/freedreno/vulkan/tu_autotune.c
index cee3321c70b..421de8bd69d 100644
--- a/src/freedreno/vulkan/tu_autotune.c
+++ b/src/freedreno/vulkan/tu_autotune.c
@@ -474,6 +474,19 @@ tu_autotune_use_bypass(struct tu_autotune *at,
    const struct tu_render_pass *pass = cmd_buffer->state.pass;
    const struct tu_framebuffer *framebuffer = cmd_buffer->state.framebuffer;
 
+   for (unsigned i = 0; i < pass->subpass_count; i++) {
+      const struct tu_subpass *subpass = &pass->subpasses[i];
+      /* GMEM works much faster in this case */
+      if (subpass->raster_order_attachment_access)
+         return false;
+
+      /* Would be very slow in sysmem mode because we have to enable
+       * SINGLE_PRIM_MODE(FLUSH_PER_OVERLAP_AND_OVERWRITE)
+       */
+      if (subpass->feedback_loop_color || subpass->feedback_loop_ds)
+         return false;
+   }
+
    /* If we would want to support buffers that could be submitted
     * several times we would have to copy the sample counts of renderpasses
     * after each submission of such buffer (like with u_trace support).



More information about the mesa-commit mailing list