r600/sfn: ACK all image stores, also at end of loop
authorGert Wollny <gert.wollny@collabora.com>
Wed, 31 Aug 2022 08:24:00 +0000 (10:24 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 1 Sep 2022 08:55:07 +0000 (08:55 +0000)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18343>

src/gallium/drivers/r600/sfn/sfn_assembler.cpp
src/gallium/drivers/r600/sfn/sfn_instr_mem.cpp

index 00197d0..265c6ca 100644 (file)
@@ -754,7 +754,7 @@ void AssamblerVisitor::visit(const RatInstr& instr)
    struct r600_bytecode_gds gds;
 
    /* The instruction writes to the retuen buffer loaction, and
-    * the value will actually be read bach, so make sure all previous writes
+    * the value will actually be read back, so make sure all previous writes
     * have been finished */
    if (m_ack_suggested /*&& instr.has_instr_flag(Instr::ack_rat_return_write)*/)
       emit_wait_ack();
@@ -1088,6 +1088,11 @@ void AssamblerVisitor::emit_loop_begin(bool vpm)
 
 void AssamblerVisitor::emit_loop_end()
 {
+   if (m_ack_suggested) {
+      emit_wait_ack();
+      m_ack_suggested = false;
+   }
+
    r600_bytecode_add_cfinst(m_bc, CF_OP_LOOP_END);
    m_callstack.pop(FC_LOOP);
    assert(m_loop_nesting);
index 4b0d835..376075d 100644 (file)
@@ -700,8 +700,7 @@ bool RatInstr::emit_image_store(nir_intrinsic_instr *intrin, Shader& shader)
    auto store = new RatInstr(op, RatInstr::STORE_TYPED, value, coord, imageid,
                              image_offset, 1, 0xf, 0);
 
-   if (nir_intrinsic_has_access(intrin) & ACCESS_COHERENT)
-      store->set_ack();
+   store->set_ack();
    shader.emit_instruction(store);
    return true;
 }