r600/sfn: Be able to track expected AR uses
authorGert Wollny <gert.wollny@collabora.com>
Fri, 10 Feb 2023 15:14:16 +0000 (16:14 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 28 Apr 2023 13:13:55 +0000 (13:13 +0000)
Because AR emission and AR use must be in the same CF we have to
be able to track whether all AR ready are emitted.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21347>

src/gallium/drivers/r600/sfn/sfn_instr.h

index 4f4d068..23b4fbe 100644 (file)
@@ -222,6 +222,13 @@ public:
 
    int inc_rat_emitted() { return ++m_emitted_rat_instr; }
 
+   void set_expected_ar_uses(uint32_t n) {m_expected_ar_uses = n;}
+   auto expected_ar_uses() const {return m_expected_ar_uses;}
+   void dec_expected_ar_uses() {
+      assert(m_expected_ar_uses > 0);
+      --m_expected_ar_uses;
+   }
+
    static void set_chipclass(r600_chip_class chip_class);
 
 private:
@@ -247,6 +254,7 @@ private:
    AluInstr *m_lds_group_start{nullptr};
    static unsigned s_max_kcache_banks;
    int m_emitted_rat_instr{0};
+   uint32_t m_expected_ar_uses{0};
 };
 
 class InstrWithResource : public Instr {