Mesa (master): r600/sfn: Make the pin_to_channel generic
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jul 20 09:42:30 UTC 2020
Module: Mesa
Branch: master
Commit: 21d296a4817fa772ef1c1da72fa0b73eb77e00ac
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=21d296a4817fa772ef1c1da72fa0b73eb77e00ac
Author: Gert Wollny <gert.wollny at collabora.com>
Date: Sun Jul 5 16:49:56 2020 +0200
r600/sfn: Make the pin_to_channel generic
Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5963>
---
src/gallium/drivers/r600/sfn/sfn_value.h | 1 +
src/gallium/drivers/r600/sfn/sfn_value_gpr.cpp | 8 ++++++++
src/gallium/drivers/r600/sfn/sfn_value_gpr.h | 3 ++-
3 files changed, 11 insertions(+), 1 deletion(-)
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<GPRValue&>(*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];}
More information about the mesa-commit
mailing list