From: Gert Wollny Date: Tue, 21 Jul 2020 09:52:41 +0000 (+0200) Subject: r600/sfn: Add a mapping table for atomics X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=702619c4126f7d69a6aab9c00b29c51e8b3a8552;p=mesa.git r600/sfn: Add a mapping table for atomics Signed-off-by: Gert Wollny Part-of: --- 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 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 #include #include +#include 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 m_atomic_base_map; }; }