Mesa (master): tu: Fix hangs for DS with no output

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 24 18:58:59 UTC 2020


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

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Wed Jul 22 23:52:50 2020 +0200

tu: Fix hangs for DS with no output

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5738>

---

 src/freedreno/vulkan/tu_pipeline.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c
index 541d834bb9c..679e76fffa4 100644
--- a/src/freedreno/vulkan/tu_pipeline.c
+++ b/src/freedreno/vulkan/tu_pipeline.c
@@ -847,6 +847,14 @@ tu6_emit_vpc(struct tu_cs *cs,
 
    tu6_setup_streamout(cs, last_shader, &linkage);
 
+   /* The GPU hangs on some models when there are no outputs (xs_pack::CNT),
+    * at least when a DS is the last stage, so add a dummy output to keep it
+    * happy if there aren't any. We do this late in order to avoid emitting
+    * any unused code and make sure that optimizations don't remove it.
+    */
+   if (linkage.cnt == 0)
+      ir3_link_add(&linkage, 0, 0x1, linkage.max_loc);
+
    /* map outputs of the last shader to VPC */
    assert(linkage.cnt <= 32);
    const uint32_t sp_out_count = DIV_ROUND_UP(linkage.cnt, 2);



More information about the mesa-commit mailing list