Mesa (master): r600/sfn: Add a mapping table for atomics

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Aug 9 14:08:40 UTC 2020


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

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Tue Jul 21 11:52:41 2020 +0200

r600/sfn: Add a mapping table for atomics

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

---

 src/gallium/drivers/r600/sfn/sfn_emitinstruction.cpp | 4 ++++
 src/gallium/drivers/r600/sfn/sfn_emitinstruction.h   | 2 ++
 src/gallium/drivers/r600/sfn/sfn_shader_base.h       | 8 ++++++++
 3 files changed, 14 insertions(+)

diff --git a/src/gallium/drivers/r600/sfn/sfn_emitinstruction.cpp b/src/gallium/drivers/r600/sfn/sfn_emitinstruction.cpp
index 62212b911c5..20e573e1f9c 100644
--- a/src/gallium/drivers/r600/sfn/sfn_emitinstruction.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_emitinstruction.cpp
@@ -174,6 +174,10 @@ bool EmitInstruction::inject_register(unsigned sel, unsigned swizzle,
    return m_proc.inject_register(sel, swizzle, reg, map);
 }
 
+int EmitInstruction::remap_atomic_base(int base)
+{
+	return m_proc.remap_atomic_base(base);
+}
 
 
 const std::set<AluModifiers> EmitInstruction::empty = {};
diff --git a/src/gallium/drivers/r600/sfn/sfn_emitinstruction.h b/src/gallium/drivers/r600/sfn/sfn_emitinstruction.h
index 16295713511..a905c3c88e7 100644
--- a/src/gallium/drivers/r600/sfn/sfn_emitinstruction.h
+++ b/src/gallium/drivers/r600/sfn/sfn_emitinstruction.h
@@ -93,6 +93,8 @@ protected:
    bool inject_register(unsigned sel, unsigned swizzle,
                         const PValue& reg, bool map);
 
+   int remap_atomic_base(int base);
+
 private:
 
    ShaderFromNirProcessor& m_proc;
diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_base.h b/src/gallium/drivers/r600/sfn/sfn_shader_base.h
index 13c94775778..e6e89c68180 100644
--- a/src/gallium/drivers/r600/sfn/sfn_shader_base.h
+++ b/src/gallium/drivers/r600/sfn/sfn_shader_base.h
@@ -46,6 +46,7 @@
 #include <vector>
 #include <set>
 #include <stack>
+#include <unordered_map>
 
 struct nir_instr;
 
@@ -85,6 +86,11 @@ public:
    void evaluate_spi_sid(r600_shader_io &io);
 
    enum chip_class get_chip_class() const;
+
+   int remap_atomic_base(int base) {
+      return m_atomic_base_map[base];
+   }
+
 protected:
 
    void set_var_address(nir_deref_instr *instr);
@@ -210,6 +216,8 @@ private:
    r600_pipe_shader_selector& m_sel;
    int m_atomic_base ;
    int m_image_count;
+
+   std::unordered_map<int, int> m_atomic_base_map;
 };
 
 }



More information about the mesa-commit mailing list