From: Gert Wollny Date: Sun, 5 Jul 2020 14:49:56 +0000 (+0200) Subject: r600/sfn: Make the pin_to_channel generic X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=21d296a4817fa772ef1c1da72fa0b73eb77e00ac;p=mesa.git r600/sfn: Make the pin_to_channel generic Signed-off-by: Gert Wollny Part-of: --- diff --git a/src/gallium/drivers/r600/sfn/sfn_value.h b/src/gallium/drivers/r600/sfn/sfn_value.h index 3a53281a7d8..222b0462b9a 100644 --- a/src/gallium/drivers/r600/sfn/sfn_value.h +++ b/src/gallium/drivers/r600/sfn/sfn_value.h @@ -86,6 +86,7 @@ public: uint32_t chan() const {return m_chan;} void set_chan(uint32_t chan); + virtual void set_pin_to_channel() { assert(0 && "Only GPRs can be pinned to a channel ");} void print(std::ostream& os, const PrintFlags& flags) const; void print(std::ostream& os) const; diff --git a/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp b/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp index bc4a0a59e65..dba5c0468e4 100644 --- a/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp @@ -152,6 +152,14 @@ void GPRVector::pin_to_channel(int i) v.set_pin_to_channel(); } +void GPRVector::pin_all_to_channel() +{ + for (auto& v: m_elms) { + auto& c = static_cast(*v); + c.set_pin_to_channel(); + } +} + void GPRVector::do_print(std::ostream& os) const { os << "R" << sel() << "."; diff --git a/src/gallium/drivers/r600/sfn/sfn_value_gpr.h b/src/gallium/drivers/r600/sfn/sfn_value_gpr.h index 589e8821744..d845e026e69 100644 --- a/src/gallium/drivers/r600/sfn/sfn_value_gpr.h +++ b/src/gallium/drivers/r600/sfn/sfn_value_gpr.h @@ -54,7 +54,7 @@ public: void set_as_input(){ m_input = true; } bool is_input() const {return m_input; } - void set_pin_to_channel() { m_pin_to_channel = true;} + void set_pin_to_channel() override { m_pin_to_channel = true;} bool pin_to_channel() const { return m_pin_to_channel;} private: @@ -94,6 +94,7 @@ public: PValue& operator [] (int i) {return m_elms[i];} void pin_to_channel(int i); + void pin_all_to_channel(); PValue x() const {return m_elms[0];} PValue y() const {return m_elms[1];}